Skip to content

Commit

Permalink
fix(ingest): move status aspect fixer logic (datahub-project#10591)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored May 30, 2024
1 parent 012930a commit 648fd45
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions metadata-ingestion/src/datahub/ingestion/api/source_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 648fd45

Please sign in to comment.