Skip to content

Commit

Permalink
Fix to insert analyses inside main loop over seqr projects (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
EddieLF authored Nov 8, 2023
1 parent ff22bab commit 6d01ce6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/data/generate_seqr_project_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ async def main():
Upserts a number of analyses for each project to test seqr related endpoints.
The upserted analyses include CRAMs, joint-called AnnotateDatasets, and ES-indexes.
"""

aapi = AnalysisApi()
papi = ProjectApi()
sapi = SampleApi()
metamist_enums: dict[str, dict[str, list[str]]] = await query_async(QUERY_ENUMS)
Expand All @@ -435,10 +435,9 @@ async def main():

await generate_joint_called_analyses(project, aligned_sgs, analyses_to_insert)

aapi = AnalysisApi()
for analyses in chunk(analyses_to_insert, 50):
logging.info(f'Inserting {len(analyses)} analysis entries')
await asyncio.gather(*[aapi.create_analysis_async(project, a) for a in analyses])
for analyses in chunk(analyses_to_insert, 50):
logging.info(f'Inserting {len(analyses)} analysis entries')
await asyncio.gather(*[aapi.create_analysis_async(project, a) for a in analyses])


if __name__ == '__main__':
Expand Down

0 comments on commit 6d01ce6

Please sign in to comment.