Skip to content

Commit

Permalink
fix: properly parsing comma-separated list on REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Sep 13, 2023
1 parent 278086a commit 5dc5cf7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cada_prio/rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ class PredictionResult(BaseModel):
# Register endpoint for the prediction
@app.get("/predict")
async def handle_predict(
hpo_terms: typing.Annotated[typing.List[str], Query()],
genes: typing.Annotated[typing.Optional[typing.List[str]], Query()] = [],
hpo_terms: typing.Annotated[str, Query()],
genes: typing.Annotated[typing.Optional[str], Query()] = [],
):
hpo_terms_list = hpo_terms.split(",")
genes_list = genes.split(",")
_, sorted_scores = predict.run_prediction(
hpo_terms,
genes,
hpo_terms_list,
genes_list,
GLOBAL_STATIC["all_to_hgnc"],
GLOBAL_STATIC["graph"],
GLOBAL_STATIC["model"],
Expand Down

0 comments on commit 5dc5cf7

Please sign in to comment.