Skip to content

Commit

Permalink
Fixing merged to correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsibilla committed Nov 30, 2023
1 parent 6c41362 commit e2d99c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/ingest_validation_tools/check_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Row = Dict[str, Any]
Check = Callable[[Row], ErrorIterator]


def make_checks(schema) -> List[Check]:
factory = _CheckFactory(schema)
return [
Expand Down
23 changes: 6 additions & 17 deletions src/ingest_validation_tools/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,29 +619,18 @@ def _check_path(
return errors

def _get_ref_errors(
self,
ref: str,
schema: SchemaVersion,
metadata_path: Union[str, Path],
self,
ref: str,
schema: SchemaVersion,
metadata_path: Union[str, Path],
):
ref_errors: DefaultDict[str, list] = defaultdict(list)
for i, row in enumerate(schema.rows):
field = f"{ref}_path"
if not row.get(field):
continue
data_path = self.directory_path / row[field]
if "metadata_schema_id" in rows[0]:
is_cedar = True
else:
is_cedar = False
ref_error = self._check_path(
i,
data_path,
ref,
schema,
metadata_path,
is_cedar=is_cedar,
)
ref_path = self.directory_path / row[field]
ref_error = self._check_path(i, ref_path, ref, schema, metadata_path)
if ref_error:
ref_errors.update(ref_error)
return ref_errors
Expand Down

0 comments on commit e2d99c8

Please sign in to comment.