Skip to content

Commit a301f79

Browse files
committed
fix(ingest/powerbi): Add workspace name filter
1 parent 7e9d056 commit a301f79

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ class PowerBiDashboardSourceConfig(
300300
description="Regex patterns to filter PowerBI workspaces in ingestion."
301301
" Note: This field works in conjunction with 'workspace_type_filter' and both must be considered when filtering workspaces.",
302302
)
303+
# PowerBi workspace name
304+
workspace_name_pattern: AllowDenyPattern = pydantic.Field(
305+
default=AllowDenyPattern.allow_all(),
306+
description="Regex patterns to filter PowerBI workspaces in ingestion."
307+
" Note: This field works in conjunction with 'workspace_type_filter' and both must be considered when filtering workspaces.",
308+
)
303309

304310
# Dataset type mapping PowerBI support many type of data-sources. Here user needs to define what type of PowerBI
305311
# DataSource needs to be mapped to corresponding DataHub Platform DataSource. For example, PowerBI `Snowflake` is

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,8 @@ def get_allowed_workspaces(self) -> List[powerbi_data_classes.Workspace]:
13061306

13071307
allowed_workspaces = []
13081308
for workspace in all_workspaces:
1309-
if not self.source_config.workspace_id_pattern.allowed(workspace.id):
1309+
if (not self.source_config.workspace_id_pattern.allowed(workspace.id)
1310+
or not self.source_config.workspace_name_pattern.allowed(workspace.name)):
13101311
self.reporter.filtered_workspace_names.append(
13111312
f"{workspace.id} - {workspace.name}"
13121313
)

0 commit comments

Comments
 (0)