@@ -582,8 +582,11 @@ def tile_custom_properties(tile: powerbi_data_classes.Tile) -> dict:
582
582
if tile .dataset is not None and tile .dataset .webUrl is not None :
583
583
custom_properties [Constant .DATASET_WEB_URL ] = tile .dataset .webUrl
584
584
585
- if tile .report is not None and tile .report .id is not None :
586
- custom_properties [Constant .REPORT_ID ] = tile .report .id
585
+ if tile .report_id is not None :
586
+ custom_properties [Constant .REPORT_ID ] = tile .report_id
587
+
588
+ if tile .report is not None and tile .report .webUrl is not None :
589
+ custom_properties [Constant .REPORT_WEB_URL ] = tile .report .webUrl
587
590
588
591
return custom_properties
589
592
@@ -1053,6 +1056,7 @@ def report_to_dashboard(
1053
1056
report : powerbi_data_classes .Report ,
1054
1057
chart_mcps : List [MetadataChangeProposalWrapper ],
1055
1058
user_mcps : List [MetadataChangeProposalWrapper ],
1059
+ dashboard_edges : List [EdgeClass ],
1056
1060
) -> List [MetadataChangeProposalWrapper ]:
1057
1061
"""
1058
1062
Map PowerBi report to Datahub dashboard
@@ -1074,6 +1078,7 @@ def report_to_dashboard(
1074
1078
charts = chart_urn_list ,
1075
1079
lastModified = ChangeAuditStamps (),
1076
1080
dashboardUrl = report .webUrl ,
1081
+ dashboards = dashboard_edges ,
1077
1082
)
1078
1083
1079
1084
info_mcp = self .new_mcp (
@@ -1167,8 +1172,28 @@ def report_to_datahub_work_units(
1167
1172
ds_mcps = self .to_datahub_dataset (report .dataset , workspace )
1168
1173
chart_mcps = self .pages_to_chart (report .pages , workspace , ds_mcps )
1169
1174
1175
+ # find all dashboards with a Tile referencing this report
1176
+ downstream_dashboards_edges = []
1177
+ for d in workspace .dashboards .values ():
1178
+ if any (t .report_id == report .id for t in d .tiles ):
1179
+ dashboard_urn = builder .make_dashboard_urn (
1180
+ platform = self .__config .platform_name ,
1181
+ platform_instance = self .__config .platform_instance ,
1182
+ name = d .get_urn_part (),
1183
+ )
1184
+ edge = EdgeClass (
1185
+ destinationUrn = dashboard_urn ,
1186
+ sourceUrn = None ,
1187
+ created = None ,
1188
+ lastModified = None ,
1189
+ properties = None ,
1190
+ )
1191
+ downstream_dashboards_edges .append (edge )
1192
+
1170
1193
# Let's convert report to datahub dashboard
1171
- report_mcps = self .report_to_dashboard (workspace , report , chart_mcps , user_mcps )
1194
+ report_mcps = self .report_to_dashboard (
1195
+ workspace , report , chart_mcps , user_mcps , downstream_dashboards_edges
1196
+ )
1172
1197
1173
1198
# Now add MCPs in sequence
1174
1199
mcps .extend (ds_mcps )
0 commit comments