Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest/looker): include dashboard urns in browse v2 #10955

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading