From e2d99c80de27ff7399f39a1c0c5b671ebe7ec7dc Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Thu, 30 Nov 2023 14:38:37 -0500 Subject: [PATCH] Fixing merged to correct tests --- src/ingest_validation_tools/check_factory.py | 1 + src/ingest_validation_tools/upload.py | 23 +++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/ingest_validation_tools/check_factory.py b/src/ingest_validation_tools/check_factory.py index 4479a2838..515de3ab3 100644 --- a/src/ingest_validation_tools/check_factory.py +++ b/src/ingest_validation_tools/check_factory.py @@ -15,6 +15,7 @@ Row = Dict[str, Any] Check = Callable[[Row], ErrorIterator] + def make_checks(schema) -> List[Check]: factory = _CheckFactory(schema) return [ diff --git a/src/ingest_validation_tools/upload.py b/src/ingest_validation_tools/upload.py index 73260c0bd..a63fc28c9 100644 --- a/src/ingest_validation_tools/upload.py +++ b/src/ingest_validation_tools/upload.py @@ -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