Skip to content

Commit

Permalink
- fixed some route signature bugs (was -> List, is -> Dict)
Browse files Browse the repository at this point in the history
- updated fastapi (which chatgpt recommended while debugging)
  • Loading branch information
Sigfried committed Nov 3, 2023
1 parent 72eb0ac commit 9f848e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions backend/routes/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ async def get_concepts_post_route(request: Request, id: Union[List[str], None] =


@router.post("/concept-ids-by-codeset-id")
async def get_concept_ids_by_codeset_id_post(request: Request, codeset_ids: Union[List[int], None] = None) -> List:
async def get_concept_ids_by_codeset_id_post(request: Request, codeset_ids: Union[List[int], None] = None) -> Dict:
print(codeset_ids)
return await get_concept_ids_by_codeset_id(request, codeset_ids)


@router.get("/concept-ids-by-codeset-id")
@return_err_with_trace
async def get_concept_ids_by_codeset_id(request: Request, codeset_ids: Union[List[str], None] = Query(...)) -> List:
async def get_concept_ids_by_codeset_id(request: Request, codeset_ids: Union[List[str], None] = Query(...)) -> Dict:
if not codeset_ids:
return [[]]

Expand All @@ -315,7 +315,8 @@ async def get_concept_ids_by_codeset_id(request: Request, codeset_ids: Union[Lis


@router.post("/codeset-ids-by-concept-id")
async def get_codeset_ids_by_concept_id_post(request: Request, concept_ids: Union[List[int], None] = None) -> List:
@return_err_with_trace
async def get_codeset_ids_by_concept_id_post(request: Request, concept_ids: Union[List[int], None] = None) -> Dict:
rpt = Api_logger()
await rpt.start_rpt(request, params={'concept_ids': concept_ids})
with get_db_connection() as con:
Expand All @@ -334,8 +335,7 @@ async def get_codeset_ids_by_concept_id_post(request: Request, concept_ids: Unio


@router.get("/codeset-ids-by-concept-id")
@return_err_with_trace
async def get_codeset_ids_by_concept_id(request=Request, concept_ids: Union[List[str], None] = Query(...)) -> List:
async def get_codeset_ids_by_concept_id(request: Request, concept_ids: Union[List[str], None] = Query(...)) -> Dict:
return await get_codeset_ids_by_concept_id_post(request, concept_ids)


Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ aiosignal==1.3.1
airium==0.2.5
alabaster==0.7.13
antlr4-python3-runtime==4.9.3
anyio==3.6.1
anyio==3.7.1
appdirs==1.4.4
arrow==1.2.3
async-timeout==4.0.2
Expand Down Expand Up @@ -36,7 +36,7 @@ EditorConfig==0.12.3
et-xmlfile==1.1.0
eutils==0.6.0
exceptiongroup==1.1.1
fastapi==0.79.0
fastapi==0.104.1
fastobo==0.12.2
filelock==3.7.1
fonttools==4.39.4
Expand Down Expand Up @@ -187,14 +187,14 @@ SQLAlchemy==2.0.15
SQLAlchemy-Utils==0.38.3
sssom==0.3.30
sssom-schema==0.11.0
starlette==0.19.1
starlette==0.27.0
stevedore==4.0.0
tabulate==0.9.0
tomli==2.0.1
tox==3.28.0
tqdm==4.65.0
typeguard==2.13.3
typing_extensions==4.3.0
typing_extensions==4.8.0
uri-template==1.2.0
url-normalize==1.4.3
urllib3==1.26.10
Expand Down

0 comments on commit 9f848e8

Please sign in to comment.