Skip to content

Commit

Permalink
Add lazy-loading for genotype
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Dec 13, 2024
1 parent 9b10663 commit 518aa5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion genotype_api/database/crud/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ async def refresh_sample_status(

async def update_sample_comment(self, sample_id: str, comment: str) -> Sample:
query: Query = (
select(Sample).options(selectinload(Sample.analyses)).filter(Sample.id == sample_id)
select(Sample)
.options(selectinload(Sample.analyses).selectinload(Analysis.genotypes))
.filter(Sample.id == sample_id)
)
sample: Sample = await self.fetch_one_or_none(query)

Expand Down

0 comments on commit 518aa5e

Please sign in to comment.