From 648fd459eb6b981a8283084fde4942fff6c9d6aa Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Wed, 29 May 2024 17:27:39 -0700 Subject: [PATCH] fix(ingest): move status aspect fixer logic (#10591) --- .../src/datahub/ingestion/api/source_helpers.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py b/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py index 91402fa3c62b25..7226258515155f 100644 --- a/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py +++ b/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py @@ -125,17 +125,16 @@ def auto_status_aspect( else: raise ValueError(f"Unexpected type {type(wu.metadata)}") - if not isinstance( - wu.metadata, MetadataChangeEventClass - ) and not entity_supports_aspect(wu.metadata.entityType, StatusClass): + yield wu + + for urn in sorted(all_urns - status_urns - skip_urns): + entity_type = guess_entity_type(urn) + if not entity_supports_aspect(entity_type, StatusClass): # If any entity does not support aspect 'status' then skip that entity from adding status aspect. # Example like dataProcessInstance doesn't suppport status aspect. # If not skipped gives error: java.lang.RuntimeException: Unknown aspect status for entity dataProcessInstance - skip_urns.add(urn) - - yield wu + continue - for urn in sorted(all_urns - status_urns - skip_urns): yield MetadataChangeProposalWrapper( entityUrn=urn, aspect=StatusClass(removed=False),