Skip to content

Commit

Permalink
fix(ingest): gracefully handle missing system metadata in client (dat…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and sleeperdeep committed Dec 17, 2024
1 parent d9523a9 commit 991ead3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions metadata-ingestion/src/datahub/ingestion/graph/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,10 @@ def get_entity_as_mcps(
post_json_obj = post_json_transform(aspect_json)
aspect_value = aspect_type.from_obj(post_json_obj["value"])

system_metadata_raw = post_json_obj["systemMetadata"]
system_metadata = SystemMetadataClass.from_obj(system_metadata_raw)
system_metadata_raw = post_json_obj.get("systemMetadata")
system_metadata = None
if system_metadata_raw:
system_metadata = SystemMetadataClass.from_obj(system_metadata_raw)

mcpw = MetadataChangeProposalWrapper(
entityUrn=entity_urn,
Expand Down Expand Up @@ -590,7 +592,7 @@ def get_entity_semityped(
not be present in the dictionary. The entity's key aspect will always be present.
"""

mcps = self.get_entity_as_mcps(entity_urn, aspects)
mcps = self.get_entity_as_mcps(entity_urn, aspects=aspects)

result: AspectBag = {}
for mcp in mcps:
Expand Down

0 comments on commit 991ead3

Please sign in to comment.