Skip to content

Commit

Permalink
emit dataplatformInstance entity
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-acryl committed Jul 19, 2024
1 parent 37ad551 commit 9b97cb7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@
ChartTypeClass,
ContainerClass,
DashboardInfoClass,
DataPlatformInfoClass,
InputFieldClass,
InputFieldsClass,
OwnerClass,
OwnershipClass,
OwnershipTypeClass,
PlatformTypeClass,
SubTypesClass,
)
from datahub.utilities.backpressure_aware_executor import BackpressureAwareExecutor
Expand Down Expand Up @@ -1570,6 +1572,25 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]:

looker_dashboards_for_usage: List[looker_usage.LookerDashboardForUsage] = []

# Emit platform instance entity
if self.source_config.platform_instance:
platform_instance_urn = builder.make_dataplatform_instance_urn(
platform=self.source_config.platform_name,
instance=self.source_config.platform_instance,
)

yield MetadataWorkUnit(
id=f"{platform_instance_urn}-aspect-dataplatformInfo",
mcp=MetadataChangeProposalWrapper(
entityUrn=platform_instance_urn,
aspect=DataPlatformInfoClass(
name=self.source_config.platform_instance,
type=PlatformTypeClass.OTHERS,
datasetNameDelimiter=".",
),
),
)

with self.reporter.report_stage("dashboard_chart_metadata"):
for job in BackpressureAwareExecutor.map(
self.process_dashboard,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
[
{
"entityType": "dataPlatformInstance",
"entityUrn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:looker,ap-south-1)",
"changeType": "UPSERT",
"aspectName": "dataPlatformInfo",
"aspect": {
"json": {
"name": "ap-south-1",
"type": "OTHERS",
"datasetNameDelimiter": "."
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:e7fe6fc9c3ca70e78694dcc5dd9c05b7",
Expand Down Expand Up @@ -802,6 +820,22 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataPlatformInstance",
"entityUrn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:looker,ap-south-1)",
"changeType": "UPSERT",
"aspectName": "status",
"aspect": {
"json": {
"removed": false
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "tag",
"entityUrn": "urn:li:tag:Dimension",
Expand Down

0 comments on commit 9b97cb7

Please sign in to comment.