fix(ingest): support patches in auto_status_aspect (#6827)

Patches generate a raw MCP because MCPW doesn't support patches right now, so we need to handle that correctly downstream.
This commit is contained in:
Harshal Sheth 2022-12-21 04:25:24 -05:00 committed by GitHub
parent a1970d2dce
commit 8972ea4b04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,11 @@ from datahub.ingestion.api.workunit import MetadataWorkUnit
from datahub.ingestion.source.state.stale_entity_removal_handler import (
StaleEntityRemovalHandler,
)
from datahub.metadata.schema_classes import MetadataChangeEventClass, StatusClass
from datahub.metadata.schema_classes import (
MetadataChangeEventClass,
MetadataChangeProposalClass,
StatusClass,
)
from datahub.utilities.urns.urn import guess_entity_type
@ -40,6 +44,9 @@ def auto_status_aspect(
elif isinstance(wu.metadata, MetadataChangeProposalWrapper):
if isinstance(wu.metadata.aspect, StatusClass):
status_urns.add(urn)
elif isinstance(wu.metadata, MetadataChangeProposalClass):
if wu.metadata.aspectName == StatusClass.ASPECT_NAME:
status_urns.add(urn)
else:
raise ValueError(f"Unexpected type {type(wu.metadata)}")