From a4230e2b3faea74795e8bd11d04e6eb86bba1d74 Mon Sep 17 00:00:00 2001 From: islean Date: Tue, 28 Jan 2025 15:03:03 +0100 Subject: [PATCH] Address comments --- cg/store/crud/read.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cg/store/crud/read.py b/cg/store/crud/read.py index dc7820848a..33afb872cd 100644 --- a/cg/store/crud/read.py +++ b/cg/store/crud/read.py @@ -1618,8 +1618,12 @@ def _get_related_samples_query( prep_categories: list[SeqLibraryPrepCategory], collaborators: set[Customer], ) -> Query: - """Returns a sample query with the same subject_id, tumour status and within the collaborators of the given - sample and within the given list of prep categories.""" + """ + Returns a sample query with the same subject_id, tumour status and within the collaborators of the given + sample and within the given list of prep categories. + Raises: + CgDataError if the number of samples matching the criteria is not 1 + """ sample_application_version_query: Query = self._get_join_sample_application_version_query() @@ -1658,6 +1662,9 @@ def get_uploaded_related_dna_cases(self, rna_case: Case) -> list[Case]: 4. The DNA sample found in 3. should also: 1. Have an application within a DNA prep category 2. Belong to a customer within the provided collaboration + + Raises: + CgDataError if no related DNA cases are found """ related_dna_cases: list[Case] = [] @@ -1730,7 +1737,7 @@ def get_related_dna_cases_with_samples(self, rna_case: Case) -> list[RNADNAColle The cases are bundled by the DNA sample found in 3. """ - collaborators = rna_case.customer.collaborators + collaborators: set[Customer] = rna_case.customer.collaborators collaborator_ids: list[int] = [collaborator.id for collaborator in collaborators] rna_dna_collections: list[RNADNACollection] = [] for sample in rna_case.samples: