From 73eb1e2c034724a53475dae8aa263c6039e40db4 Mon Sep 17 00:00:00 2001 From: jp3477 Date: Wed, 15 Sep 2021 09:56:39 -0400 Subject: [PATCH] reduced date errors to the first instance (#15) --- omop_file_validator.py | 2 ++ .../examples_erroneous/errors/results.csv | 3 +-- .../examples_erroneous/errors/results.html | 24 +++++++------------ tests/test_reporter.py | 4 ++-- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/omop_file_validator.py b/omop_file_validator.py index e3d9ce0..735f182 100644 --- a/omop_file_validator.py +++ b/omop_file_validator.py @@ -419,6 +419,8 @@ def run_checks(file_path, f): actual=value, expected=meta_column_type) result['errors'].append(e) + #only return the first error + break # Check if any nulls present in a required field if meta_column_required and df[submission_column].isnull( diff --git a/tests/resources/examples_erroneous/errors/results.csv b/tests/resources/examples_erroneous/errors/results.csv index a5ce278..bc52f02 100644 --- a/tests/resources/examples_erroneous/errors/results.csv +++ b/tests/resources/examples_erroneous/errors/results.csv @@ -21,6 +21,5 @@ "observation.csv","Observation","Type mismatch line number 5","observation_id","23.890+11","integer" "observation.csv","Observation","Invalid date format. Expecting ""YYYY-MM-DD"": line number 5","observation_date","01-31-1963","date" "observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 1","observation_datetime","1989-10-07 22:13:11.1533266","timestamp" -"observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 3","observation_datetime","1987-04-15 06:06:30.6260548","timestamp" -"observation.csv","Observation","Invalid timestamp format. Expecting ""YYYY-MM-DD HH:MM:SS[.SSSSSS]"": line number 5","observation_datetime","1983-05-13 15:31:52.3905384","timestamp" "observation.csv","Observation","Type mismatch line number 3","observation_type_concept_id","unknown","integer" +"visit_detail.csv","Visit Detail","NULL values are not allowed for column","visit_occurrence_id","","" diff --git a/tests/resources/examples_erroneous/errors/results.html b/tests/resources/examples_erroneous/errors/results.html index 5aaef74..0159f93 100644 --- a/tests/resources/examples_erroneous/errors/results.html +++ b/tests/resources/examples_erroneous/errors/results.html @@ -242,22 +242,6 @@

Local File Validation Error Results

- - - - - - - - - - - - @@ -266,6 +250,14 @@

Local File Validation Error Results

observation_datetime1987-04-15 06:06:30.6260548timestamp
observation.csvObservationInvalid timestamp format. Expecting "YYYY-MM-DD HH:MM:SS[.SSSSSS]": line number 5observation_datetime1983-05-13 15:31:52.3905384timestamp
observation.csv Observation