Skip to content

Commit

Permalink
revert changes in rest sink
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Jul 2, 2024
1 parent a254b78 commit 58dd78d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
4 changes: 2 additions & 2 deletions metadata-ingestion/src/datahub/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def generate_access_token(


def ensure_mce_has_system_metadata(mce: MetadataChangeEvent) -> None:
if not mce.systemMetadata:
if mce.systemMetadata is None:
mce.systemMetadata = SystemMetadataClass()
mce.systemMetadata.clientId = datahub.__package_name__
mce.systemMetadata.clientVersion = datahub.__version__
Expand All @@ -701,7 +701,7 @@ def ensure_mce_has_system_metadata(mce: MetadataChangeEvent) -> None:
def ensure_mcp_has_system_metadata(
mcp: Union[MetadataChangeProposal, MetadataChangeProposalWrapper]
) -> None:
if not mcp.systemMetadata:
if mcp.systemMetadata is None:
mcp.systemMetadata = SystemMetadataClass()
mcp.systemMetadata.clientId = datahub.__package_name__
mcp.systemMetadata.clientVersion = datahub.__version__
1 change: 1 addition & 0 deletions metadata-ingestion/src/datahub/emitter/rest_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def emit_mce(self, mce: MetadataChangeEvent) -> None:
system_metadata_obj = {
"lastObserved": mce.systemMetadata.lastObserved,
"runId": mce.systemMetadata.runId,
"lastRunId": mce.systemMetadata.lastRunId,
"clientId": mce.systemMetadata.clientId,
"clientVersion": mce.systemMetadata.clientVersion,
}
Expand Down
24 changes: 3 additions & 21 deletions metadata-ingestion/tests/unit/test_rest_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,7 @@
}
}
},
"systemMetadata": {
"clientId": "acryl-datahub",
"clientVersion": "1!0.0.0.dev0",
"lastObserved": 0,
"lastRunId": "no-run-id-provided",
"runId": "no-run-id-provided",
},
"systemMetadata": {},
},
),
(
Expand Down Expand Up @@ -131,13 +125,7 @@
}
}
},
"systemMetadata": {
"clientId": "acryl-datahub",
"clientVersion": "1!0.0.0.dev0",
"lastObserved": 0,
"lastRunId": "no-run-id-provided",
"runId": "no-run-id-provided",
},
"systemMetadata": {},
},
),
(
Expand Down Expand Up @@ -173,13 +161,7 @@
}
}
},
"systemMetadata": {
"clientId": "acryl-datahub",
"clientVersion": "1!0.0.0.dev0",
"lastObserved": 0,
"lastRunId": "no-run-id-provided",
"runId": "no-run-id-provided",
},
"systemMetadata": {},
},
),
(
Expand Down

0 comments on commit 58dd78d

Please sign in to comment.