Skip to content

Commit

Permalink
fix(ingest/powerbi): use only single reference to workspace urn
Browse files Browse the repository at this point in the history
  • Loading branch information
looppi committed Oct 26, 2023
1 parent 6869a13 commit a4f7354
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ def to_datahub_dataset(

self.append_container_mcp(
dataset_mcps,
workspace,
ds_urn,
dataset,
)
Expand All @@ -474,11 +473,7 @@ def to_datahub_dataset(
dataset.tags,
)

dataset.workspace_key = workspace.get_workspace_key(
platform_name=self.__config.platform_name,
platform_instance=self.__config.platform_instance,
workspace_id_as_urn_part=self.__config.workspace_id_as_urn_part,
)
dataset.workspace_key = self.workspace_key
self.processed_datasets.add(dataset)

return dataset_mcps
Expand Down Expand Up @@ -578,7 +573,6 @@ def tile_custom_properties(tile: powerbi_data_classes.Tile) -> dict:

self.append_container_mcp(
result_mcps,
workspace,
chart_urn,
)

Expand Down Expand Up @@ -701,7 +695,6 @@ def chart_custom_properties(dashboard: powerbi_data_classes.Dashboard) -> dict:

self.append_container_mcp(
list_of_mcps,
workspace,
dashboard_urn,
)

Expand All @@ -717,7 +710,6 @@ def chart_custom_properties(dashboard: powerbi_data_classes.Dashboard) -> dict:
def append_container_mcp(
self,
list_of_mcps: List[MetadataChangeProposalWrapper],
workspace: powerbi_data_classes.Workspace,
entity_urn: str,
dataset: Optional[powerbi_data_classes.PowerBIDataset] = None,
) -> None:
Expand All @@ -726,11 +718,7 @@ def append_container_mcp(
):
container_key = dataset.get_dataset_key(self.__config.platform_name)
elif self.__config.extract_workspaces_to_containers:
container_key = workspace.get_workspace_key(
platform_name=self.__config.platform_name,
platform_instance=self.__config.platform_instance,
workspace_id_as_urn_part=self.__config.workspace_id_as_urn_part,
)
container_key = self.workspace_key
else:
return None

Expand Down Expand Up @@ -971,7 +959,6 @@ def to_chart_mcps(

self.append_container_mcp(
list_of_mcps,
workspace,
chart_urn,
)

Expand Down Expand Up @@ -1092,7 +1079,6 @@ def report_to_dashboard(

self.append_container_mcp(
list_of_mcps,
workspace,
dashboard_urn,
)

Expand Down

0 comments on commit a4f7354

Please sign in to comment.