Commit b7711d89 authored by Rajesh Bollineni's avatar Rajesh Bollineni
Browse files

Update validate_referential_integrity.py to bypass validation check for SourceRecordID for Dataset

parent 0b49bb3e
Pipeline #52385 passed with stages
in 1 minute and 53 seconds
......@@ -90,6 +90,10 @@ class ManifestIntegrity:
for elem in manifest_section[data_type]:
if elem.get("id"):
entities_ids.append(elem["id"])
if elem.get("data"):
if elem["data"].get("DatasetProperties"):
if elem["data"]["DatasetProperties"].get("SourceRecordID"):
entities_ids.append(elem["data"]["DatasetProperties"]["SourceRecordID"])
return entities_ids
def _collect_manifest_entities_ids(self, manifest: dict):
......@@ -129,6 +133,10 @@ class ManifestIntegrity:
set(self._match_id_with_pattern(pattern, manifest_str))
)
references.discard(entity.get("id"))
if entity.get("data"):
if entity["data"].get("DatasetProperties"):
if entity["data"]["DatasetProperties"].get("SourceRecordID"):
references.discard(entity.get("data").get("DatasetProperties").get("SourceRecordID"))
logger.debug(f"References of {entity.get('id')}: {references}")
return references
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment