Skip to content

fix(sigma): populate dataModels field on dashboard during ingestion - #29608

Open
zak-nuccio wants to merge 3 commits into
open-metadata:mainfrom
zak-nuccio:pr/sigma-datamodel-population
Open

fix(sigma): populate dataModels field on dashboard during ingestion#29608
zak-nuccio wants to merge 3 commits into
open-metadata:mainfrom
zak-nuccio:pr/sigma-datamodel-population

Conversation

@zak-nuccio

@zak-nuccio zak-nuccio commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #29607

Applied the same comprehension guarded by self.source_config.includeDataModels that the Tableau connector uses.

  • Updated EXPECTED_DASHBOARD in the Sigma test to include the new field
  • Added test_yield_dashboard_with_datamodels (2 data models in context, asserts both FQNs on the dashboard)
  • Added test_yield_dashboard_datamodels_disabled (asserts dataModels is None when toggled off)

Greptile Summary

This PR fixes the Sigma connector so that data models ingested via yield_datamodel are properly referenced in the CreateDashboardRequest during yield_dashboard. Previously, the dataModels field was never populated, so dashboards had no link to their data models.

  • Adds a dataModels list comprehension in yield_dashboard that builds FQNs from self.context.get().dataModels, guarded by self.source_config.includeDataModels (returns None when disabled).
  • Updates EXPECTED_DASHBOARD in the Sigma unit test to include dataModels=[] and adds two targeted tests covering the enabled and disabled flag paths.

Confidence Score: 5/5

Safe to merge — the change is a narrow, well-tested addition that populates a previously empty field.

The fix mirrors an established pattern already used by the Tableau connector. The or [] guard prevents iteration errors when no data models are in context, the else None branch correctly signals disabled state, and three test cases cover the enabled path (with FQN assertions), the disabled path, and the pre-existing baseline. No existing behavior is altered.

No files require special attention.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/dashboard/sigma/metadata.py Adds dataModels comprehension to yield_dashboard, correctly guarded by includeDataModels; mirrors the Tableau connector pattern.
ingestion/tests/unit/topology/dashboard/test_sigma.py Updates EXPECTED_DASHBOARD and adds two new tests covering includeDataModels=True (with FQN assertions) and includeDataModels=False (expects None).

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant T as Topology Engine
    participant DM as yield_datamodel
    participant CTX as Context (dataModels[])
    participant YD as yield_dashboard

    T->>DM: call yield_datamodel(details)
    DM->>DM: "filter by includeDataModels & vizualizationType"
    DM->>CTX: register_record_datamodel appends elementId
    T->>YD: call yield_dashboard(details)
    YD->>CTX: read dataModels list
    alt "includeDataModels = True"
        YD->>YD: build FQNs for each dataModel
        YD-->>T: CreateDashboardRequest with dataModels list
    else "includeDataModels = False"
        YD-->>T: "CreateDashboardRequest with dataModels=None"
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant T as Topology Engine
    participant DM as yield_datamodel
    participant CTX as Context (dataModels[])
    participant YD as yield_dashboard

    T->>DM: call yield_datamodel(details)
    DM->>DM: "filter by includeDataModels & vizualizationType"
    DM->>CTX: register_record_datamodel appends elementId
    T->>YD: call yield_dashboard(details)
    YD->>CTX: read dataModels list
    alt "includeDataModels = True"
        YD->>YD: build FQNs for each dataModel
        YD-->>T: CreateDashboardRequest with dataModels list
    else "includeDataModels = False"
        YD-->>T: "CreateDashboardRequest with dataModels=None"
    end
Loading

Reviews (8): Last reviewed commit: "fix(sigma): use pytest-style asserts and..." | Re-trigger Greptile

@zak-nuccio
zak-nuccio requested a review from a team as a code owner June 30, 2026 08:33
Copilot AI review requested due to automatic review settings June 30, 2026 08:33
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment thread ingestion/tests/unit/topology/dashboard/test_sigma.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Sigma dashboard ingestion to populate the dataModels field on CreateDashboardRequest, aligning Sigma behavior with other dashboard connectors that link dashboards to their data models via FQNs.

Changes:

  • Populate CreateDashboardRequest.dataModels in SigmaSource.yield_dashboard() when includeDataModels is enabled (otherwise set it to None).
  • Update the Sigma unit test expected dashboard to include dataModels.
  • Add unit tests to validate dataModels population when enabled and None when disabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ingestion/src/metadata/ingestion/source/dashboard/sigma/metadata.py Adds dataModels FQN list to the dashboard create request, gated by includeDataModels.
ingestion/tests/unit/topology/dashboard/test_sigma.py Updates expected request + adds tests for enabled/disabled dataModels behavior.

Comment on lines +272 to +282
self.sigma.source_config.includeDataModels = True
self.sigma.context.get().__dict__["dataModels"] = ["elem1", "elem2"]

results = list(self.sigma.yield_dashboard(MOCK_DASHBOARD_DETAILS))
dashboard_request = results[0].right

self.assertIsNotNone(dashboard_request.dataModels)
self.assertEqual(len(dashboard_request.dataModels), 2)
for dm_fqn in dashboard_request.dataModels:
self.assertIn("mock_sigma", dm_fqn.root)

@zak-nuccio
zak-nuccio force-pushed the pr/sigma-datamodel-population branch from deb5bd3 to f5bbc8c Compare June 30, 2026 08:42
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI review requested due to automatic review settings July 2, 2026 09:19
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +268 to +286
def test_yield_dashboard_with_datamodels(self):
"""
Function for testing that dashboard includes dataModels when includeDataModels is True
"""
self.sigma.source_config.includeDataModels = True
original_data_models = self.sigma.context.get().dataModels
self.sigma.context.get().__dict__["dataModels"] = ["elem1", "elem2"]

try:
results = list(self.sigma.yield_dashboard(MOCK_DASHBOARD_DETAILS))
dashboard_request = results[0].right

self.assertIsNotNone(dashboard_request.dataModels)
self.assertEqual(len(dashboard_request.dataModels), 2)
self.assertEqual(dashboard_request.dataModels[0].root, "mock_sigma.elem1")
self.assertEqual(dashboard_request.dataModels[1].root, "mock_sigma.elem2")
finally:
self.sigma.context.get().__dict__["dataModels"] = original_data_models

Comment on lines +287 to +297
def test_yield_dashboard_datamodels_disabled(self):
"""
Function for testing that dataModels is None when includeDataModels is False
"""
self.sigma.source_config.includeDataModels = False

results = list(self.sigma.yield_dashboard(MOCK_DASHBOARD_DETAILS))
dashboard_request = results[0].right

self.assertIsNone(dashboard_request.dataModels)

@zak-nuccio

Copy link
Copy Markdown
Contributor Author

Anything else I need to do to move this over the line?

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI review requested due to automatic review settings July 4, 2026 16:25
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines +283 to +284
self.assertEqual(dashboard_request.dataModels[0].root, "mock_sigma.elem1")
self.assertEqual(dashboard_request.dataModels[1].root, "mock_sigma.elem2")
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@IceS2

IceS2 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Hey @zak-nuccio, can you please address the PR comments? couple ones from the bots are relevant

Copilot AI review requested due to automatic review settings July 17, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

SigmaSource.yield_dashboard() was creating CreateDashboardRequest
without the dataModels field. The topology processes yield_datamodel
before yield_dashboard, so self.context.get().dataModels already
holds the element names — this change passes them through to the
API as FullyQualifiedEntityName references, matching the pattern
used by the Tableau connector.

Tests:
- Updated EXPECTED_DASHBOARD to include dataModels=[]
- test_yield_dashboard_with_datamodels: verifies 2 data model FQNs
  appear when includeDataModels=True
- test_yield_dashboard_datamodels_disabled: verifies dataModels is
  None when includeDataModels=False
Copilot flagged state leak — test_yield_dashboard_with_datamodels and
test_yield_dashboard_datamodels_disabled mutated
source_config.includeDataModels without restoring the original value,
making later tests order-dependent. Save and restore the original flag
in a finally block on both tests.
…odels test

The fqn.build for DashboardDataModel produces '<service>.model.<name>' (confirmed at fqn.py:586), so the test assertion needs the 'model.' segment.

Also convert to plain pytest-style assert per review feedback.
Copilot AI review requested due to automatic review settings July 20, 2026 13:45
@zak-nuccio
zak-nuccio force-pushed the pr/sigma-datamodel-population branch from b27b846 to 3daab96 Compare July 20, 2026 13:45
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Populates the dataModels field on Sigma dashboards during ingestion by mirroring the Tableau connector pattern, with new unit tests validating both enabled and disabled states. No issues found.

✅ 1 resolved
Quality: New tests use unittest asserts instead of plain assert

📄 ingestion/tests/unit/topology/dashboard/test_sigma.py:268-282
The added tests test_yield_dashboard_with_datamodels and test_yield_dashboard_datamodels_disabled use self.assertIsNotNone/self.assertEqual/self.assertIn/self.assertIsNone. The project's Python testing guideline prefers pytest-style plain assert without unittest inheritance. This matches the surrounding file's existing style (which uses TestCase), so it is low priority, but new tests could use plain assert to align with the stated convention.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 16 pipeline/setup failure(s)

✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped

Pipeline and setup failures

  • The build job finished with status failure.
  • The Playwright shard matrix was unexpectedly skipped.
  • Shard 1 did not upload a usable Playwright results artifact.
  • Shard 2 did not upload a usable Playwright results artifact.
  • Shard 3 did not upload a usable Playwright results artifact.
  • Shard 4 did not upload a usable Playwright results artifact.
  • Shard 5 did not upload a usable Playwright results artifact.
  • Shard 6 did not upload a usable Playwright results artifact.
  • Shard 7 did not upload a usable Playwright results artifact.
  • Shard 1 did not upload its execution status.
  • Shard 2 did not upload its execution status.
  • Shard 3 did not upload its execution status.
  • Shard 4 did not upload its execution status.
  • Shard 5 did not upload its execution status.
  • Shard 6 did not upload its execution status.
  • Shard 7 did not upload its execution status.
Shard Passed Failed Flaky Skipped
⛔ Shard 1
⛔ Shard 2
⛔ Shard 3
⛔ Shard 4
⛔ Shard 5
⛔ Shard 6
⛔ Shard 7

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@zak-nuccio

Copy link
Copy Markdown
Contributor Author

@IceS2 rebased on latest main and addressed the review feedback:

  • Converted unittest self.assert* calls to pytest-style plain assert
  • Fixed the FQN assertions — fqn.build for DashboardDataModel produces <service>.model.<name>, so the test now asserts "mock_sigma.model.elem1" instead of "mock_sigma.elem1"

Mind taking another look?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines +139 to +151
dataModels=[
FullyQualifiedEntityName(
fqn.build(
self.metadata,
entity_type=DashboardDataModel,
service_name=self.context.get().dashboard_service,
data_model_name=data_model,
)
)
for data_model in self.context.get().dataModels or []
]
if self.source_config.includeDataModels
else None,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sigma dashboards missing dataModels field during ingestion

3 participants