Skip to content

Commit 216abea

Browse files
refactor
1 parent 39c8e61 commit 216abea

File tree

1 file changed

+14
-19
lines changed
  • metadata-ingestion/src/datahub/ingestion/source/powerbi

1 file changed

+14
-19
lines changed

metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py

+14-19
Original file line numberDiff line numberDiff line change
@@ -948,33 +948,28 @@ def to_datahub_work_units(
948948
# Convert tiles to charts
949949
ds_mcps, chart_mcps = self.to_datahub_chart(dashboard.tiles, workspace)
950950

951-
# collect all downstream reports
952-
downstream_dashboards_edges = []
951+
# collect all downstream reports (dashboards)
952+
dashboard_edges = []
953953
for t in dashboard.tiles:
954-
if t.report_id:
955-
report = workspace.reports.get(t.report_id)
956-
if report is None:
957-
# a title referencing a missed report was already reported during "fill_dashboards"
958-
continue
959-
954+
if t.report:
960955
dashboard_urn = builder.make_dashboard_urn(
961956
platform=self.__config.platform_name,
962957
platform_instance=self.__config.platform_instance,
963-
name=report.get_urn_part(),
958+
name=t.report.get_urn_part(),
964959
)
965960
edge = EdgeClass(
966961
destinationUrn=dashboard_urn,
967-
sourceUrn=None,
968-
created=None,
969-
lastModified=None,
970-
properties=None,
971962
)
972-
downstream_dashboards_edges.append(edge)
963+
dashboard_edges.append(edge)
973964

974965
# Lets convert dashboard to datahub dashboard
975966
dashboard_mcps: List[MetadataChangeProposalWrapper] = (
976967
self.to_datahub_dashboard_mcp(
977-
dashboard, workspace, chart_mcps, user_mcps, downstream_dashboards_edges
968+
dashboard=dashboard,
969+
workspace=workspace,
970+
chart_mcps=chart_mcps,
971+
user_mcps=user_mcps,
972+
dashboard_edges=dashboard_edges,
978973
)
979974
)
980975

@@ -1198,10 +1193,10 @@ def report_to_datahub_work_units(
11981193

11991194
# Let's convert report to datahub dashboard
12001195
report_mcps = self.report_to_dashboard(
1201-
workspace,
1202-
report,
1203-
chart_mcps,
1204-
user_mcps,
1196+
workspace=workspace,
1197+
report=report,
1198+
chart_mcps=chart_mcps,
1199+
user_mcps=user_mcps,
12051200
)
12061201

12071202
# Now add MCPs in sequence

0 commit comments

Comments
 (0)