Skip to content

Commit

Permalink
Reformat with line length 100
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiara Rasi committed Nov 15, 2024
1 parent 4710fbd commit 8713e5a
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions preClinVar/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ async def root():


@app.post("/apitest-status")
async def apitest_status(
api_key: str = Form(), submission_id: str = Form()
) -> JSONResponse:
async def apitest_status(api_key: str = Form(), submission_id: str = Form()) -> JSONResponse:
"""Returns the status (validation) of a test submission to the apitest endpoint."""

# Create a submission header
Expand Down Expand Up @@ -162,9 +160,7 @@ async def tsv_2_json(
)
return JSONResponse(
status_code=400,
content={
"message": f"Created json file contains validation errors: {valid_results[1]}"
},
content={"message": f"Created json file contains validation errors: {valid_results[1]}"},
)


Expand Down Expand Up @@ -223,9 +219,7 @@ async def csv_2_json(
)
return JSONResponse(
status_code=400,
content={
"message": f"Created json file contains validation errors: {valid_results[1]}"
},
content={"message": f"Created json file contains validation errors: {valid_results[1]}"},
)


Expand All @@ -252,9 +246,7 @@ async def dry_run(api_key: str = Form(), clinvar_accession: str = Form()):
header = build_header(api_key)

# Create a submission deletion object
delete_obj = {
"clinvarDeletion": {"accessionSet": [{"accession": clinvar_accession}]}
}
delete_obj = {"clinvarDeletion": {"accessionSet": [{"accession": clinvar_accession}]}}

data = {
"actions": [
Expand All @@ -268,12 +260,6 @@ async def dry_run(api_key: str = Form(), clinvar_accession: str = Form()):
# And send a POST request to the API
resp = requests.post(SUBMISSION_URL, data=json.dumps(data), headers=header)

# A successful response will be an empty response with code 204 (A dry-run submission was successful and no submission was created)
if resp.status_code == 204:
return JSONResponse(
status_code=200,
content={"message": "success"},
)
return JSONResponse(
status_code=resp.status_code,
content=resp.json(),
Expand Down

0 comments on commit 8713e5a

Please sign in to comment.