From 4f38368ba6dccbedc401fe4f3e5c9f2cdeaef0dd Mon Sep 17 00:00:00 2001 From: Teppo Naakka Date: Thu, 7 Dec 2023 10:05:36 +0200 Subject: [PATCH 1/3] fix(ingest/powerbi): dataset container handling fix --- .../src/datahub/ingestion/source/powerbi/powerbi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py index dc4394efcf245b..b1bd1579311f94 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py @@ -504,7 +504,7 @@ def to_datahub_chart_mcp( logger.info(f"{Constant.CHART_URN}={chart_urn}") - ds_input: List[str] = self.to_urn_set(ds_mcps) + ds_input: List[str] = self.to_urn_set([x for x in ds_mcps if x.entityType == Constant.DATASET]) def tile_custom_properties(tile: powerbi_data_classes.Tile) -> dict: custom_properties: dict = { @@ -927,7 +927,7 @@ def to_chart_mcps( logger.debug(f"{Constant.CHART_URN}={chart_urn}") - ds_input: List[str] = self.to_urn_set(ds_mcps) + ds_input: List[str] = self.to_urn_set([x for x in ds_mcps if x.entityType == Constant.DATASET]) # Create chartInfo mcp # Set chartUrl only if tile is created from Report From f8b2d9734753c9af7d3e84c1ca3d3432af32ba9d Mon Sep 17 00:00:00 2001 From: Teppo Naakka Date: Fri, 8 Dec 2023 13:09:27 +0200 Subject: [PATCH 2/3] fix(ingest/powerbi): remove containers from chart inputs --- .../integration/powerbi/golden_test_container.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/metadata-ingestion/tests/integration/powerbi/golden_test_container.json b/metadata-ingestion/tests/integration/powerbi/golden_test_container.json index 91b5499eaadcb4..7a9ce135b4e240 100644 --- a/metadata-ingestion/tests/integration/powerbi/golden_test_container.json +++ b/metadata-ingestion/tests/integration/powerbi/golden_test_container.json @@ -1400,9 +1400,6 @@ } }, "inputs": [ - { - "string": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2" - }, { "string": "urn:li:dataset:(urn:li:dataPlatform:powerbi,library-dataset.public_issue_history,DEV)" }, @@ -1546,9 +1543,6 @@ } }, "inputs": [ - { - "string": "urn:li:container:977b804137a1d2bf897ff1bbf440a1cc" - }, { "string": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.dbo_book_issue,DEV)" }, @@ -2387,9 +2381,6 @@ } }, "inputs": [ - { - "string": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2" - }, { "string": "urn:li:dataset:(urn:li:dataPlatform:powerbi,library-dataset.public_issue_history,DEV)" }, @@ -2514,9 +2505,6 @@ } }, "inputs": [ - { - "string": "urn:li:container:6ac0662f0f2fc3a9196ac505da2182b2" - }, { "string": "urn:li:dataset:(urn:li:dataPlatform:powerbi,library-dataset.public_issue_history,DEV)" }, From c0b332ae41adf827c6bb91e1dca91fa5e1285b83 Mon Sep 17 00:00:00 2001 From: Teppo Naakka Date: Fri, 8 Dec 2023 13:23:00 +0200 Subject: [PATCH 3/3] fix(formatting): fix formatting --- .../src/datahub/ingestion/source/powerbi/powerbi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py index b1bd1579311f94..4b1d0403ac7760 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py +++ b/metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py @@ -504,7 +504,9 @@ def to_datahub_chart_mcp( logger.info(f"{Constant.CHART_URN}={chart_urn}") - ds_input: List[str] = self.to_urn_set([x for x in ds_mcps if x.entityType == Constant.DATASET]) + ds_input: List[str] = self.to_urn_set( + [x for x in ds_mcps if x.entityType == Constant.DATASET] + ) def tile_custom_properties(tile: powerbi_data_classes.Tile) -> dict: custom_properties: dict = { @@ -927,7 +929,9 @@ def to_chart_mcps( logger.debug(f"{Constant.CHART_URN}={chart_urn}") - ds_input: List[str] = self.to_urn_set([x for x in ds_mcps if x.entityType == Constant.DATASET]) + ds_input: List[str] = self.to_urn_set( + [x for x in ds_mcps if x.entityType == Constant.DATASET] + ) # Create chartInfo mcp # Set chartUrl only if tile is created from Report