From 8f4d056372f2bf058536109bded9a92ce4a39ff5 Mon Sep 17 00:00:00 2001 From: ahdamin Date: Fri, 13 Dec 2024 14:22:54 +0100 Subject: [PATCH] Add genotype analysis loading --- genotype_api/database/crud/read.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/genotype_api/database/crud/read.py b/genotype_api/database/crud/read.py index ef2c9de..518e69f 100644 --- a/genotype_api/database/crud/read.py +++ b/genotype_api/database/crud/read.py @@ -247,7 +247,11 @@ def _get_samples_with_analyses_and_genotypes() -> Query: return ( select(Sample) .distinct() - .options(selectinload(Sample.analyses).selectinload(Analysis.genotypes)) + .options( + selectinload(Sample.analyses) + .selectinload(Analysis.genotypes) + .selectinload(Genotype.analysis) + ) .join(Analysis, Analysis.sample_id == Sample.id) )