Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ensembl endpoints and db model #7

Closed
wants to merge 23 commits into from

Conversation

projectoriented
Copy link
Contributor

This PR adds | fixes:

How to prepare for test:

  • ssh to ...
  • Install on stage:
    bash servers/resources/SERVER.scilifelab.se/update-[THIS_TOOL]-stage.sh [THIS-BRANCH-NAME]

How to test:

Expected outcome:

  • [ ]

Review:

  • Code approved by
  • Tests executed by
  • "Merge and deploy" approved by

This version is a:

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

@projectoriented

This comment was marked as outdated.

@projectoriented

This comment was marked as outdated.

Copy link
Contributor

@henrikstranneheim henrikstranneheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool to see a working example!

src/schug/endpoints/ensembl.py Show resolved Hide resolved
src/schug/endpoints/ensembl.py Show resolved Hide resolved
src/schug/endpoints/ensembl.py Outdated Show resolved Hide resolved
src/schug/endpoints/ensembl.py Outdated Show resolved Hide resolved
return ensembl_genes


@router.get("/{ensembl_gene_id}", response_model=List[EnsemblTranscriptRead])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@router.get("/{ensembl_gene_id}", response_model=List[EnsemblTranscriptRead])
@router.get("/{ensembl_gene_id}", response_model=List[EnsemblTranscript])

Right? How it was produced is not important to the caller

src/schug/endpoints/ensembl.py Show resolved Hide resolved
src/schug/endpoints/ensembl.py Outdated Show resolved Hide resolved
src/schug/endpoints/ensembl.py Show resolved Hide resolved
src/schug/endpoints/ensembl.py Outdated Show resolved Hide resolved
src/schug/endpoints/ensembl.py Outdated Show resolved Hide resolved
@projectoriented
Copy link
Contributor Author

projectoriented commented Feb 3, 2022

note to self: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204 use this status code because 404 (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404) means client requested resource doesn't exist when it does

EDIT: seems more difficult than I thought because

A special case is 204, "No Content". This response is used when there is no content to return to the client, and so the response must not have a body.

and the return of my endpoints do have a body if wrong client input i.e. empty array
https://fastapi.tiangolo.com/tutorial/response-status-code/#:~:text=A%20special%20case%20is%20204,must%20not%20have%20a%20body.

Taking Henrik's http class from atlas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create endpoints which return genomic coordinates Define database models
2 participants