Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# A Sigma dashboard's project is the workspace of its workbook

- **Status:** Accepted
- **Revisions:** v1 2026-11-07 (initial)
- **Revisions:** v1 2026-11-07 (initial) · v2 2026-11-25 (standalone data models)
- **Deciders:** Sigma connector maintainers (PR #37297)
- **Guard:** `ingestion/tests/unit/topology/dashboard/test_sigma.py` (`test_dashboard_project_is_the_workbook_workspace`,
`test_project_filter_pattern_keeps_or_drops_by_workspace`)
- **Related:** PR #37297
`test_project_filter_pattern_keeps_or_drops_by_workspace`, `test_workspace_filter_on_standalone_data_models`)
- **Related:** PR #37297, issue #38477, PR #38616

## Context

Expand All @@ -32,3 +32,13 @@ takes more Sigma calls per workbook.
saved pattern matches.
- The rule rests on Sigma's doc examples, as the spec does not define the workbook `path` format. A workspace name
that contains `/` is cut at the first `/`.

## Amendment: standalone data models

In both regular and organization-wide listings, a standalone data model's workspace is the first
`/`-separated segment of its `path` in the `GET /v2/dataModels` response. The connector applies
`projectFilterPattern` to that workspace before reading the model's elements, columns or lineage.

A saved pattern that selects one workspace now limits standalone models as well as workbooks.
If the pattern has any includes or excludes, a model with no path is skipped because its workspace
is unknown. With no includes or excludes, models with missing paths remain eligible for ingestion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
)
from metadata.ingestion.source.database.column_helpers import truncate_column_name
from metadata.utils import fqn
from metadata.utils.filters import filter_by_chart, filter_by_datamodel
from metadata.utils.filters import filter_by_chart, filter_by_datamodel, filter_by_project
from metadata.utils.helpers import (
get_database_name_for_lineage,
get_standard_chart_type,
Expand Down Expand Up @@ -274,7 +274,7 @@ def get_dashboard_name(self, dashboard: Workbook) -> str | None:
"""
return dashboard.name

def get_project_name(self, dashboard_details: WorkbookDetails) -> str | None:
def get_project_name(self, dashboard_details: WorkbookDetails | DataModel) -> str | None:
"""
The workspace: Sigma's path starts with it and continues with the folders
(ADR:2026-11-07-a-sigma-dashboard-project-is-the-workbook-workspace)
Expand Down Expand Up @@ -1011,6 +1011,9 @@ def yield_bulk_datamodel( # pyright: ignore[reportIncompatibleMethodOverride]
yield from self._yield_data_model_lineage()
return
display_name = data_model.name or data_model.dataModelId
if filter_by_project(self.source_config.projectFilterPattern, self.get_project_name(data_model) or ""):
self.status.filter(display_name, "Project / Workspace Filtered Out")
return
if filter_by_datamodel(self.source_config.dataModelFilterPattern, display_name):
self.status.filter(display_name, "Data model filtered out.")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def node_schema(self):


class DataModel(BaseModel):
path: str | None = None
dataModelId: str # noqa: N815
dataModelUrlId: str | None = None # noqa: N815
name: str | None = None
Expand Down
30 changes: 30 additions & 0 deletions ingestion/tests/unit/topology/dashboard/test_sigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,36 @@ def test_data_model_filter_pattern_applies_to_sigma_data_models(sigma_over_http,
assert calls["GET", "/v2/dataModels/dm-1/elements"] == 0


@pytest.mark.parametrize("list_all_assets", [False, True])
@pytest.mark.parametrize(
"pattern, other_path, kept",
[
(FilterPattern(includes=["^Accounting$"]), "Sandbox/Accounting", ["dm-1"]),
(FilterPattern(excludes=["^Accounting$"]), "Sandbox/Accounting", ["dm-2"]),
(FilterPattern(includes=["^Accounting$"]), None, ["dm-1"]),
(None, None, ["dm-1", "dm-2"]),
],
)
def test_workspace_filter_on_standalone_data_models(
sigma_over_http, two_sigma_data_models, list_all_assets, pattern, other_path, kept
):
source, calls = sigma_over_http
source.client.config.listAllAssets = list_all_assets
source.source_config.projectFilterPattern = pattern
accounting, other = two_sigma_data_models["GET", "/v2/dataModels"]["entries"]
accounting["path"] = "Accounting/Reports"
other["path"] = other_path
two_sigma_data_models["GET", "/v2/dataModels/dm-2/columns"] = {"entries": []}
scope = (ORG_WIDE_DATA_MODELS,) if list_all_assets else ()
two_sigma_data_models[("GET", "/v2/dataModels") + scope] = {"entries": [other], "nextPage": "2"}
two_sigma_data_models[("GET", "/v2/dataModels", "2") + scope] = {"entries": [accounting]}

assert sorted(model.name.root for model in bulk_data_models(source)) == kept
for model_id in {"dm-1", "dm-2"} - set(kept):
for endpoint in ("elements", "columns", "lineage"):
assert calls["GET", f"/v2/dataModels/{model_id}/{endpoint}"] == 0


def test_a_sigma_data_model_is_owned_by_its_owner(sigma_over_http, sigma_data_models):
source, _ = sigma_over_http
# The data model's ownerId is member-1, whose email is ada@example.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ When **Include Tags** is on, a workbook's certification badge (Endorsed, Warning

## Projects

A Sigma workbook's project is its workspace, the first part of the workbook's path in Sigma (for example `My Documents`). **Project Filter Pattern** includes or excludes workbooks by that workspace name.
**Project Filter Pattern** selects workbooks and standalone data models by workspace in both listing modes. For example, add `^Accounting$` to **Includes** to ingest assets from the Accounting workspace and its folders. A folder named Accounting inside another workspace does not match. The connector reads the workspace from the first part of the Sigma path. Assets without a path are skipped when a pattern is active.

## Data Models

Expand Down
Loading