Skip to content

Commit

Permalink
attempting to make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
gesinaphillips committed Jul 25, 2023
1 parent 37f070d commit 440fdf0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Added examples for fields with pattern constraint
- Replaced `preparation_temperature` with `preparation_condition` and updated associated enumerations in the sample-section, sample-block, and sample-suspension schemas
- Replaced `storage_temperature` with `storage_method` and updated associated enumerations in the sample-section, sample-block, and sample-suspension schemas
- Updated upload.py to integrate CEDAR validation
- Updated upload.py to integrate CEDAR validation, replaced walrus operators
- Updated CEDAR validation routine based on changes to Spreadsheet Validator

## v0.0.15 - 2023-04-04
Expand Down
21 changes: 14 additions & 7 deletions src/ingest_validation_tools/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,26 @@ def get_errors(self, **kwargs) -> dict:

errors = {}

if tsv_errors := self._check_tsvs():
tsv_errors = self._check_tsvs()
if tsv_errors:
errors["Metadata TSV Errors"] = tsv_errors

if dir_errors := self.get_directory_errors():
dir_errors = self.get_directory_errors()
if dir_errors:
errors["Directory Errors"] = dir_errors

if validation_errors := self.cedar_validation_routine():
validation_errors = self.cedar_validation_routine()
if validation_errors:
errors["Validation Errors"] = validation_errors
# if validation_errors := self.local_validation_routine():
# errors["Validation Errors"] = validation_errors

if reference_errors := self._get_reference_errors():
reference_errors = self._get_reference_errors()
if reference_errors:
errors["Reference Errors"] = reference_errors

if plugin_errors := self._get_plugin_errors(**kwargs):
plugin_errors = self._get_plugin_errors(**kwargs)
if plugin_errors:
errors["Plugin Errors"] = plugin_errors

return errors
Expand Down Expand Up @@ -167,7 +172,8 @@ def get_directory_errors(self) -> dict:
if not row.get("data_path"):
continue
path = self.directory_path / row["data_path"]
if ref_errors := self.__get_ref_errors("data", path, schema_name):
ref_errors = self.__get_ref_errors("data", path, schema_name)
if ref_errors:
single_path_errors[f"{row_number}, data {path}"] = ref_errors
errors[f"{path} (as {schema_name})"] = single_path_errors
return errors
Expand Down Expand Up @@ -208,7 +214,8 @@ def cedar_validation_routine(self) -> dict:

def local_validation_routine(self) -> dict:
errors = {}
if tsv_errors := self._get_tsv_errors():
tsv_errors = self._get_tsv_errors()
if tsv_errors:
errors["Metadata TSV Errors"] = tsv_errors
return errors

Expand Down

0 comments on commit 440fdf0

Please sign in to comment.