Skip to content

Commit

Permalink
Changing error message
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstretenowich committed Nov 29, 2023
1 parent 620fdf4 commit 8674a8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project_tracking/api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def patients(project_id: str, patient_id: str = None):
Return: a subset of patient who have Tumor=False & Tumor=True samples
(false, true):
return: a subset of patient who only have Tumor=True samples
(false, true):
(false, false):
return: a subset of patient who only have Tumor=false samples
"""

Expand Down
12 changes: 6 additions & 6 deletions project_tracking/db_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if patient:
patients.append(patient)
else:
raise DidNotFindError(table="Patient", attribute="name", query=patient_name)
raise DidNotFindError(f"'Patient' with 'name' '{patient_name}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if vb.PATIENT_ID in digest_data.keys():
for patient_id in digest_data[vb.PATIENT_ID]:
# logger.debug(f"\n\n{patient_id}\n\n")
Expand All @@ -807,7 +807,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if patient:
patients.append(patient)
else:
raise DidNotFindError(table="Patient", attribute="id", query=patient_id)
raise DidNotFindError(f"'Patient' with 'id' '{patient_id}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if patients:
set(patients)
for patient in patients:
Expand All @@ -827,7 +827,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if sample:
samples.append(sample)
else:
raise DidNotFindError(table="Sample", attribute="name", query=sample_name)
raise DidNotFindError(f"'Sample' with 'name' '{patient_name}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if vb.SAMPLE_ID in digest_data.keys():
for sample_id in digest_data[vb.SAMPLE_ID]:
# logger.debug(f"\n\n{sample_id}\n\n")
Expand All @@ -841,7 +841,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if sample:
samples.append(sample)
else:
raise DidNotFindError(table="Sample", attribute="id", query=sample_id)
raise DidNotFindError(f"'Sample' with 'id' '{patient_name}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if samples:
set(samples)
for sample in samples:
Expand All @@ -859,7 +859,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if readset:
readsets.append(readset)
else:
raise DidNotFindError(table="Readset", attribute="name", query=readset_name)
raise DidNotFindError(f"'Readset' with 'name' '{patient_name}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if vb.READSET_ID in digest_data.keys():
for readset_id in digest_data[vb.READSET_ID]:
readset = session.scalars(
Expand All @@ -871,7 +871,7 @@ def digest_readset_file(project_id: str, digest_data, session=None):
if readset:
readsets.append(readset)
else:
raise DidNotFindError(table="Readset", attribute="id", query=readset_id)
raise DidNotFindError(f"'Readset' with 'id' '{patient_name}' AND 'nucleic_acid_type' '{nucleic_acid_type}' doesn't exist on database")
if readsets:
set(readsets)
for readset in readsets:
Expand Down

0 comments on commit 8674a8a

Please sign in to comment.