Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1325: Don't add required_but_missing fields to failure list #35

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def validate_schema(self, schema_name, map_json):
}
self.statistics["required_but_missing"][schema_name][f]["total"] += 1
if f not in map_json:
self.warn(f"{f} required for {schema_name}")
# self.warn(f"{f} required for {schema_name}")
self.statistics["required_but_missing"][schema_name][f]["missing"] += 1
if case not in self.statistics["cases_missing_data"]:
self.statistics["cases_missing_data"].append(case)
Expand Down
3 changes: 1 addition & 2 deletions test_data_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,14 @@ def test_donor_2(packets):
def test_validation(packets, schema):
schema.validate_ingest_map({"donors": packets})
print(schema.validation_failures)
assert len(schema.validation_failures) == 9
assert len(schema.validation_failures) == 8
# should be the following 9 failures:
# DONOR_5: cause_of_death required if is_deceased = Yes
# DONOR_5: date_of_death required if is_deceased = Yes
# DONOR_5 > PD_5: clinical_stage_group is required for clinical_tumour_staging_system Revised International staging system (RISS)
# DONOR_5 > PD_5 > SPECIMEN_6: Tumour specimens require a reference_pathology_confirmed_diagnosis
# DONOR_5 > PD_5 > TR_5 > Radiation 1: Only one radiation is allowed per treatment
# DONOR_5 > PD_5 > TR_5 > Radiation 1: reference_radiation_treatment_id required if radiation_boost = Yes
# DONOR_5 > PD_5 > TR_10: response_to_treatment required for treatments
# DONOR_5 > PD_5 > TR_10: treatment type Immunotherapy should have one or more immunotherapies submitted
# DONOR_6 > PD_6 > TR_9 > Surgery 0: submitter_specimen_id SPECIMEN_43 does not correspond to one of the available specimen_ids ['SPECIMEN_3']

Expand Down