Skip to content

Commit

Permalink
feat(ingest/looker): include dashboard urns in browse v2 (datahub-pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and aviv-julienjehannet committed Jul 25, 2024
1 parent 687c4ac commit 3aa2b43
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,12 @@ def _make_chart_metadata_events(
)
chart_snapshot.aspects.append(browse_path)

dashboard_urn = self.make_dashboard_urn(dashboard)
browse_path_v2 = BrowsePathsV2Class(
path=[
BrowsePathEntryClass("Folders"),
*self._get_folder_browse_path_v2_entries(dashboard.folder),
BrowsePathEntryClass(id=dashboard.title),
BrowsePathEntryClass(id=dashboard_urn, urn=dashboard_urn),
],
)
elif (
Expand Down Expand Up @@ -819,7 +820,7 @@ def _make_dashboard_metadata_events(

return proposals

def make_dashboard_urn(self, looker_dashboard):
def make_dashboard_urn(self, looker_dashboard: LookerDashboard) -> str:
return builder.make_dashboard_urn(
self.source_config.platform_name, looker_dashboard.get_urn_dashboard_id()
)
Expand Down Expand Up @@ -1202,9 +1203,7 @@ def _input_fields_from_dashboard_element(
def _make_metrics_dimensions_dashboard_mcp(
self, dashboard: LookerDashboard
) -> MetadataChangeProposalWrapper:
dashboard_urn = builder.make_dashboard_urn(
self.source_config.platform_name, dashboard.get_urn_dashboard_id()
)
dashboard_urn = self.make_dashboard_urn(dashboard)
all_fields = []
for dashboard_element in dashboard.dashboard_elements:
all_fields.extend(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
"urn": "urn:li:container:691314a7b63628684d62a14861d057a8"
},
{
"id": "foo"
"id": "urn:li:dashboard:(looker,dashboards.1)",
"urn": "urn:li:dashboard:(looker,dashboards.1)"
}
]
}
Expand Down Expand Up @@ -807,8 +808,8 @@
}
},
{
"entityType": "chart",
"entityUrn": "urn:li:chart:(looker,dashboard_elements.10)",
"entityType": "container",
"entityUrn": "urn:li:container:621eb6e00da9abece0f64522f81be0e7",
"changeType": "UPSERT",
"aspectName": "status",
"aspect": {
Expand All @@ -824,8 +825,8 @@
}
},
{
"entityType": "dashboard",
"entityUrn": "urn:li:dashboard:(looker,dashboards.11)",
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "status",
"aspect": {
Expand All @@ -841,8 +842,8 @@
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:621eb6e00da9abece0f64522f81be0e7",
"entityType": "dashboard",
"entityUrn": "urn:li:dashboard:(looker,dashboards.11)",
"changeType": "UPSERT",
"aspectName": "status",
"aspect": {
Expand All @@ -858,8 +859,8 @@
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"entityType": "chart",
"entityUrn": "urn:li:chart:(looker,dashboard_elements.10)",
"changeType": "UPSERT",
"aspectName": "status",
"aspect": {
Expand Down

0 comments on commit 3aa2b43

Please sign in to comment.