diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/config.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/config.py index 9692eca4176fad..83d3336644d001 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/config.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/config.py @@ -132,6 +132,7 @@ class Constant: ACTIVE = "Active" SQL_PARSING_FAILURE = "SQL Parsing Failure" M_QUERY_NULL = '"null"' + REPORT_WEB_URL = "reportWebUrl" @dataclass diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py index 89184d37569ffc..4342be1448b299 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py @@ -582,8 +582,11 @@ def tile_custom_properties(tile: powerbi_data_classes.Tile) -> dict: if tile.dataset is not None and tile.dataset.webUrl is not None: custom_properties[Constant.DATASET_WEB_URL] = tile.dataset.webUrl - if tile.report is not None and tile.report.id is not None: - custom_properties[Constant.REPORT_ID] = tile.report.id + if tile.report_id is not None: + custom_properties[Constant.REPORT_ID] = tile.report_id + + if tile.report is not None and tile.report.webUrl is not None: + custom_properties[Constant.REPORT_WEB_URL] = tile.report.webUrl return custom_properties @@ -1053,6 +1056,7 @@ def report_to_dashboard( report: powerbi_data_classes.Report, chart_mcps: List[MetadataChangeProposalWrapper], user_mcps: List[MetadataChangeProposalWrapper], + dashboard_edges: List[EdgeClass], ) -> List[MetadataChangeProposalWrapper]: """ Map PowerBi report to Datahub dashboard @@ -1074,6 +1078,7 @@ def report_to_dashboard( charts=chart_urn_list, lastModified=ChangeAuditStamps(), dashboardUrl=report.webUrl, + dashboards=dashboard_edges, ) info_mcp = self.new_mcp( @@ -1167,8 +1172,28 @@ def report_to_datahub_work_units( ds_mcps = self.to_datahub_dataset(report.dataset, workspace) chart_mcps = self.pages_to_chart(report.pages, workspace, ds_mcps) + # find all dashboards with a Tile referencing this report + downstream_dashboards_edges = [] + for d in workspace.dashboards.values(): + if any(t.report_id == report.id for t in d.tiles): + dashboard_urn = builder.make_dashboard_urn( + platform=self.__config.platform_name, + platform_instance=self.__config.platform_instance, + name=d.get_urn_part(), + ) + edge = EdgeClass( + destinationUrn=dashboard_urn, + sourceUrn=None, + created=None, + lastModified=None, + properties=None, + ) + downstream_dashboards_edges.append(edge) + # Let's convert report to datahub dashboard - report_mcps = self.report_to_dashboard(workspace, report, chart_mcps, user_mcps) + report_mcps = self.report_to_dashboard( + workspace, report, chart_mcps, user_mcps, downstream_dashboards_edges + ) # Now add MCPs in sequence mcps.extend(ds_mcps) diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_classes.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_classes.py index f3e968896b3c96..a5ee6e7bc60aaf 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_classes.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_classes.py @@ -286,11 +286,15 @@ class CreatedFrom(Enum): id: str title: str embedUrl: str - dataset: Optional["PowerBIDataset"] dataset_id: Optional[str] - report: Optional[Report] + report_id: Optional[str] createdFrom: CreatedFrom + # In a first pass, `dataset_id` and/or `report_id` are filled in. + # In a subsequent pass, the objects are populated. + dataset: Optional["PowerBIDataset"] + report: Optional[Report] + def get_urn_part(self): return f"charts.{self.id}" diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_resolver.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_resolver.py index 927840c44bf0b0..d98f4abc296778 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_resolver.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/data_resolver.py @@ -337,41 +337,6 @@ def get_tiles(self, workspace: Workspace, dashboard: Dashboard) -> List[Tile]: -tiles), there is no information available on pagination """ - - def new_dataset_or_report(tile_instance: Any) -> dict: - """ - Find out which is the data source for tile. It is either REPORT or DATASET - """ - report_fields = { - Constant.REPORT: ( - self.get_report( - workspace=workspace, - report_id=tile_instance.get(Constant.REPORT_ID), - ) - if tile_instance.get(Constant.REPORT_ID) is not None - else None - ), - Constant.CREATED_FROM: Tile.CreatedFrom.UNKNOWN, - } - - # reportId and datasetId are exclusive in tile_instance - # if datasetId is present that means tile is created from dataset - # if reportId is present that means tile is created from report - # if both i.e. reportId and datasetId are not present then tile is created from some visualization - if tile_instance.get(Constant.REPORT_ID) is not None: - report_fields[Constant.CREATED_FROM] = Tile.CreatedFrom.REPORT - elif tile_instance.get(Constant.DATASET_ID) is not None: - report_fields[Constant.CREATED_FROM] = Tile.CreatedFrom.DATASET - else: - report_fields[Constant.CREATED_FROM] = Tile.CreatedFrom.VISUALIZATION - - title: Optional[str] = tile_instance.get(Constant.TITLE) - _id: Optional[str] = tile_instance.get(Constant.ID) - created_from: Any = report_fields[Constant.CREATED_FROM] - logger.info(f"Tile {title}({_id}) is created from {created_from}") - - return report_fields - tile_list_endpoint: str = self.get_tiles_endpoint( workspace, dashboard_id=dashboard.id ) @@ -393,8 +358,18 @@ def new_dataset_or_report(tile_instance: Any) -> dict: title=instance.get(Constant.TITLE), embedUrl=instance.get(Constant.EMBED_URL), dataset_id=instance.get(Constant.DATASET_ID), + report_id=instance.get(Constant.REPORT_ID), dataset=None, - **new_dataset_or_report(instance), + report=None, + createdFrom=( + # In the past we considered that only one of the two report_id or dataset_id would be present + # but we have seen cases where both are present. If both are present, we prioritize the report. + Tile.CreatedFrom.REPORT + if instance.get(Constant.REPORT_ID) + else Tile.CreatedFrom.DATASET + if instance.get(Constant.DATASET_ID) + else Tile.CreatedFrom.VISUALIZATION + ), ) for instance in tile_dict if instance is not None diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/powerbi_api.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/powerbi_api.py index 93d734652f0ff1..efc6ea5b30b335 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/powerbi_api.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/rest_api_wrapper/powerbi_api.py @@ -625,13 +625,26 @@ def fill_dashboards() -> None: dashboard.tiles = self._get_resolver().get_tiles( workspace, dashboard=dashboard ) - # set the dataset for tiles + # set the dataset and the report for tiles for tile in dashboard.tiles: + # In Power BI, dashboards, reports, and datasets are tightly scoped to the workspace they belong to. + # https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-new-workspaces + if tile.report_id: + tile.report = workspace.reports.get(tile.report_id) + if tile.report is None: + self.reporter.info( + title="Missing Report Lineage For Tile", + message="A Report reference that failed to be resolved. Please ensure that 'extract_reports' is set to True in the configuration.", + context=f"workspace-name: {workspace.name}, tile-name: {tile.title}, report-id: {tile.report_id}", + ) + # However, semantic models (aka datasets) can be shared accross workspaces + # https://learn.microsoft.com/en-us/fabric/admin/portal-workspace#use-semantic-models-across-workspaces + # That's why the global 'dataset_registry' is required if tile.dataset_id: tile.dataset = self.dataset_registry.get(tile.dataset_id) if tile.dataset is None: self.reporter.info( - title="Missing Lineage For Tile", + title="Missing Dataset Lineage For Tile", message="A cross-workspace reference that failed to be resolved. Please ensure that no global workspace is being filtered out due to the workspace_id_pattern.", context=f"workspace-name: {workspace.name}, tile-name: {tile.title}, dataset-id: {tile.dataset_id}", ) @@ -653,10 +666,10 @@ def fill_dashboard_tags() -> None: for dashboard in workspace.dashboards.values(): dashboard.tags = workspace.dashboard_endorsements.get(dashboard.id, []) + # fill reports first since some dashboard may reference a report + fill_reports() if self.__config.extract_dashboards: fill_dashboards() - - fill_reports() fill_dashboard_tags() self._fill_independent_datasets(workspace=workspace) diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_admin_access_not_allowed.json b/metadata-ingestion/tests/integration/powerbi/golden_test_admin_access_not_allowed.json index 1394a140b0a245..6604883f8bd7ca 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_admin_access_not_allowed.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_admin_access_not_allowed.json @@ -39,8 +39,9 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", - "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445" + "createdFrom": "Report", + "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_cll.json b/metadata-ingestion/tests/integration/powerbi/golden_test_cll.json index 5881ad5de0bcb8..96413ffeebc940 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_cll.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_cll.json @@ -81,9 +81,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_container.json b/metadata-ingestion/tests/integration/powerbi/golden_test_container.json index 50058405a7aec5..87fb8e5a4f0d87 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_container.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_container.json @@ -92,14 +92,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "containerProperties", + "aspectName": "container", "aspect": { "json": { - "customProperties": { - "platform": "powerbi", - "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" - }, - "name": "library-dataset" + "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" } }, "systemMetadata": { @@ -112,10 +108,14 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "status", + "aspectName": "containerProperties", "aspect": { "json": { - "removed": false + "customProperties": { + "platform": "powerbi", + "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" + }, + "name": "library-dataset" } }, "systemMetadata": { @@ -128,10 +128,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "dataPlatformInstance", + "aspectName": "status", "aspect": { "json": { - "platform": "urn:li:dataPlatform:powerbi" + "removed": false } }, "systemMetadata": { @@ -144,12 +144,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "subTypes", + "aspectName": "dataPlatformInstance", "aspect": { "json": { - "typeNames": [ - "Semantic Model" - ] + "platform": "urn:li:dataPlatform:powerbi" } }, "systemMetadata": { @@ -162,10 +160,12 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "container", + "aspectName": "subTypes", "aspect": { "json": { - "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" + "typeNames": [ + "Semantic Model" + ] } }, "systemMetadata": { @@ -1004,14 +1004,10 @@ "entityType": "container", "entityUrn": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc", "changeType": "UPSERT", - "aspectName": "containerProperties", + "aspectName": "container", "aspect": { "json": { - "customProperties": { - "platform": "powerbi", - "dataset": "ba0130a1-5b03-40de-9535-b34e778ea6ed" - }, - "name": "hr_pbi_test" + "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" } }, "systemMetadata": { @@ -1024,10 +1020,14 @@ "entityType": "container", "entityUrn": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc", "changeType": "UPSERT", - "aspectName": "status", + "aspectName": "containerProperties", "aspect": { "json": { - "removed": false + "customProperties": { + "platform": "powerbi", + "dataset": "ba0130a1-5b03-40de-9535-b34e778ea6ed" + }, + "name": "hr_pbi_test" } }, "systemMetadata": { @@ -1040,10 +1040,10 @@ "entityType": "container", "entityUrn": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc", "changeType": "UPSERT", - "aspectName": "dataPlatformInstance", + "aspectName": "status", "aspect": { "json": { - "platform": "urn:li:dataPlatform:powerbi" + "removed": false } }, "systemMetadata": { @@ -1056,12 +1056,10 @@ "entityType": "container", "entityUrn": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc", "changeType": "UPSERT", - "aspectName": "subTypes", + "aspectName": "dataPlatformInstance", "aspect": { "json": { - "typeNames": [ - "Semantic Model" - ] + "platform": "urn:li:dataPlatform:powerbi" } }, "systemMetadata": { @@ -1074,10 +1072,12 @@ "entityType": "container", "entityUrn": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc", "changeType": "UPSERT", - "aspectName": "container", + "aspectName": "subTypes", "aspect": { "json": { - "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" + "typeNames": [ + "Semantic Model" + ] } }, "systemMetadata": { @@ -1377,10 +1377,13 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715", + "reportWebUrl": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715" }, + "externalUrl": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715", "title": "test_tile", "description": "test_tile", "lastModified": { @@ -1867,14 +1870,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "containerProperties", + "aspectName": "container", "aspect": { "json": { - "customProperties": { - "platform": "powerbi", - "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" - }, - "name": "library-dataset" + "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" } }, "systemMetadata": { @@ -1887,10 +1886,14 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "status", + "aspectName": "containerProperties", "aspect": { "json": { - "removed": false + "customProperties": { + "platform": "powerbi", + "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" + }, + "name": "library-dataset" } }, "systemMetadata": { @@ -1903,10 +1906,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "dataPlatformInstance", + "aspectName": "status", "aspect": { "json": { - "platform": "urn:li:dataPlatform:powerbi" + "removed": false } }, "systemMetadata": { @@ -1919,12 +1922,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "subTypes", + "aspectName": "dataPlatformInstance", "aspect": { "json": { - "typeNames": [ - "Semantic Model" - ] + "platform": "urn:li:dataPlatform:powerbi" } }, "systemMetadata": { @@ -1937,10 +1938,12 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "container", + "aspectName": "subTypes", "aspect": { "json": { - "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" + "typeNames": [ + "Semantic Model" + ] } }, "systemMetadata": { @@ -2945,6 +2948,13 @@ "path": "/dashboardUrl", "value": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715" }, + { + "op": "add", + "path": "/dashboards/urn:li:dashboard:(powerbi,dashboards.7D668CAD-7FFC-4505-9215-655BCA5BEBAE)", + "value": { + "destinationUrn": "urn:li:dashboard:(powerbi,dashboards.7D668CAD-7FFC-4505-9215-655BCA5BEBAE)" + } + }, { "op": "add", "path": "/lastModified", @@ -3089,14 +3099,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "containerProperties", + "aspectName": "container", "aspect": { "json": { - "customProperties": { - "platform": "powerbi", - "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" - }, - "name": "library-dataset" + "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" } }, "systemMetadata": { @@ -3109,10 +3115,14 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "status", + "aspectName": "containerProperties", "aspect": { "json": { - "removed": false + "customProperties": { + "platform": "powerbi", + "dataset": "05169CD2-E713-41E6-9600-1D8066D95445" + }, + "name": "library-dataset" } }, "systemMetadata": { @@ -3125,10 +3135,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "dataPlatformInstance", + "aspectName": "status", "aspect": { "json": { - "platform": "urn:li:dataPlatform:powerbi" + "removed": false } }, "systemMetadata": { @@ -3141,12 +3151,10 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "subTypes", + "aspectName": "dataPlatformInstance", "aspect": { "json": { - "typeNames": [ - "Semantic Model" - ] + "platform": "urn:li:dataPlatform:powerbi" } }, "systemMetadata": { @@ -3159,10 +3167,12 @@ "entityType": "container", "entityUrn": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2", "changeType": "UPSERT", - "aspectName": "container", + "aspectName": "subTypes", "aspect": { "json": { - "container": "urn:li:container:a4ed52f9abd3ff9cc34960c0c41f72e9" + "typeNames": [ + "Semantic Model" + ] } }, "systemMetadata": { diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_disabled_ownership.json b/metadata-ingestion/tests/integration/powerbi/golden_test_disabled_ownership.json index 099f75a190ca26..3cd79437ee528f 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_disabled_ownership.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_disabled_ownership.json @@ -410,9 +410,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_endorsement.json b/metadata-ingestion/tests/integration/powerbi/golden_test_endorsement.json index 07bb4f9aaad44c..a126a9bb67dbe1 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_endorsement.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_endorsement.json @@ -526,9 +526,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_ingest.json b/metadata-ingestion/tests/integration/powerbi/golden_test_ingest.json index 4bbd2e2b06542c..33c6f2c1e5e3c0 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_ingest.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_ingest.json @@ -432,9 +432,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_ingest_patch_disabled.json b/metadata-ingestion/tests/integration/powerbi/golden_test_ingest_patch_disabled.json index a943472f307e5c..f76c3ecfdecf03 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_ingest_patch_disabled.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_ingest_patch_disabled.json @@ -432,9 +432,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_lineage.json b/metadata-ingestion/tests/integration/powerbi/golden_test_lineage.json index df56bdc45db762..49da7c7eeb4dfd 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_lineage.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_lineage.json @@ -516,9 +516,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_lower_case_urn_ingest.json b/metadata-ingestion/tests/integration/powerbi/golden_test_lower_case_urn_ingest.json index 4c27dec3c67520..f96841a71e6c88 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_lower_case_urn_ingest.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_lower_case_urn_ingest.json @@ -173,9 +173,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_platform_instance_ingest.json b/metadata-ingestion/tests/integration/powerbi/golden_test_platform_instance_ingest.json index b2ec0f7a67a969..c4a4fc6cc24bd2 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_platform_instance_ingest.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_platform_instance_ingest.json @@ -718,9 +718,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_report.json b/metadata-ingestion/tests/integration/powerbi/golden_test_report.json index 1805272b84d486..8f0e9eab428979 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_report.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_report.json @@ -705,10 +705,13 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715", + "reportWebUrl": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715" }, + "externalUrl": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715", "title": "test_tile", "description": "test_tile", "lastModified": { @@ -1990,6 +1993,13 @@ "path": "/dashboardUrl", "value": "https://app.powerbi.com/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/reports/5b218778-e7a5-4d73-8187-f10824047715" }, + { + "op": "add", + "path": "/dashboards/urn:li:dashboard:(powerbi,dashboards.7D668CAD-7FFC-4505-9215-655BCA5BEBAE)", + "value": { + "destinationUrn": "urn:li:dashboard:(powerbi,dashboards.7D668CAD-7FFC-4505-9215-655BCA5BEBAE)" + } + }, { "op": "add", "path": "/lastModified", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_scan_all_workspaces.json b/metadata-ingestion/tests/integration/powerbi/golden_test_scan_all_workspaces.json index bc0feef4a127d3..36afe746e94333 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_scan_all_workspaces.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_scan_all_workspaces.json @@ -25,9 +25,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_server_to_platform_instance.json b/metadata-ingestion/tests/integration/powerbi/golden_test_server_to_platform_instance.json index bcf7b76285110a..ea4c39e56aaa99 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_server_to_platform_instance.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_server_to_platform_instance.json @@ -516,9 +516,10 @@ "aspect": { "json": { "customProperties": { - "createdFrom": "Dataset", + "createdFrom": "Report", "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", - "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details" + "datasetWebUrl": "http://localhost/groups/64ED5CAD-7C10-4684-8180-826122881108/datasets/05169CD2-E713-41E6-9600-1D8066D95445/details", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, "title": "test_tile", "description": "test_tile", diff --git a/metadata-ingestion/tests/integration/powerbi/mock_data/default_mock_response.json b/metadata-ingestion/tests/integration/powerbi/mock_data/default_mock_response.json index 28972fbded9e82..a9fad07478d4cb 100644 --- a/metadata-ingestion/tests/integration/powerbi/mock_data/default_mock_response.json +++ b/metadata-ingestion/tests/integration/powerbi/mock_data/default_mock_response.json @@ -149,7 +149,8 @@ "id": "B8E293DC-0C83-4AA0-9BB9-0A8738DF24A0", "title": "test_tile", "embedUrl": "https://localhost/tiles/embed/1", - "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445" + "datasetId": "05169CD2-E713-41E6-9600-1D8066D95445", + "reportId": "5b218778-e7a5-4d73-8187-f10824047715" }, { "id": "23212598-23b5-4980-87cc-5fc0ecd84385", diff --git a/metadata-ingestion/tests/integration/powerbi/test_powerbi.py b/metadata-ingestion/tests/integration/powerbi/test_powerbi.py index 571c0092dcc8c1..2179e94af358b1 100644 --- a/metadata-ingestion/tests/integration/powerbi/test_powerbi.py +++ b/metadata-ingestion/tests/integration/powerbi/test_powerbi.py @@ -1440,12 +1440,12 @@ def test_powerbi_cross_workspace_reference_info_message( is_entry_present: bool = False # Printing INFO entries for entry in info_entries.values(): - if entry.title == "Missing Lineage For Tile": + if entry.title == "Missing Dataset Lineage For Tile": is_entry_present = True break assert is_entry_present, ( - 'Info message "Missing Lineage For Tile" should be present in reporter' + 'Info message "Missing Dataset Lineage For Tile" should be present in reporter' ) test_resources_dir = pytestconfig.rootpath / "tests/integration/powerbi"