Skip to content

Fixes 5952: [Lineage] Draw Dashboard to Chart edges in the shared dashboard topology - #34985

Merged
mohittilala merged 6 commits into
mainfrom
feat/dashboard-chart-lineage
Oct 9, 2026
Merged

mohittilala merged 6 commits into
mainfrom
feat/dashboard-chart-lineage

Conversation

@mohittilala

@mohittilala mohittilala commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#5952

Dashboard connectors create Dashboard and Chart entities, but nothing drew a lineage edge between them, so the visual hierarchy could not be walked through the lineage graph. The shared dashboard topology now draws one Dashboard → Chart edge for every chart the server holds under each dashboard, so every dashboard connector gets the edges without connector code.

Testing the overrideLineage rerun also exposed a bug in the ingestion client. The lineage edge cache was process wide, so a workflow that ran after another one in the same process found an edge its own override run had just deleted, took it as still stored, and never wrote it back. Nothing was logged. The cache now lives on the client, which lasts one workflow.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

A stage of its own. The edges come from a new stage in the dashboard node, right after the dashboard is written. Connectors that replace the dashboard lineage stage entirely (Rill does) still get the edges, and an error in a connector's own lineage cannot stop them.

Read back from the server. The stage flushes the sink with a Barrier, reads the dashboard back with its charts, and draws one edge per chart reference. The server's dashboard to chart relation is exactly the set of charts created under the dashboard: a chart excluded by chartFilterPattern or one that failed in the connector never reaches the dashboard request, and a dashboard that references a chart the server does not hold is rejected as a whole. The read returns chart references, which is all an edge needs, so no chart is fetched on its own. That costs one read per dashboard plus one write per edge.

Lineage semantics. Edges use the DashboardLineage source and go through the same path as the other dashboard lineage, so overrideLineage applies. A rerun cannot duplicate an edge, since the server keeps one edge per entity pair. With override on, a chart's existing dashboard lineage is deleted once per run before its first new edge, so edges from other dashboards or upstream data models into the same chart survive.

Edge cache. The lineage edge lookups were cached in a module level LRU, while the override delete is deduplicated per client. A later workflow in the same process could therefore answer an edge lookup from an edge that had been deleted in between, skip the write, and drop the edge. The cache now lives on the client, so it has the same lifetime as the delete deduplication. Within one workflow it still spares repeat reads exactly as before.

Alternatives considered.

  • Drawing the edges inside the existing dashboard lineage stage: simpler, but Rill replaces that stage and would never get them.
  • Looking each chart up by name from the topology context: one read per chart instead of one per dashboard, and the context holds names the server may have rejected.
  • FQN based lineage requests with no read at all: cheapest on the client, but a chart or dashboard the server rejected would come back as one lineage error per edge, on top of the original failure.

Failed dashboards. The dashboard name in the topology context is now cleared after each dashboard. A dashboard that failed in the connector used to leave its predecessor's name behind, so the stages after it (data model lineage, Looker lineage and usage, and the new chart edges) worked on the previous dashboard. They now see no dashboard.

Compatibility. No schema change and no migration. The edges are always drawn, so lineage graphs gain chart nodes downstream of each dashboard after the next ingestion run. Connectors that already draw edges into charts (Looker explores, Metabase tables) keep them.

Tests:

Use cases covered

  • A Tableau workbook with three views gets exactly three Dashboard → Chart edges, all with the DashboardLineage source.
  • A view excluded by chartFilterPattern gets no chart and no edge.
  • A view that fails in the connector gets no chart and no edge, and its workbook still links its other charts.
  • Each dashboard links only its own charts.
  • A rerun adds no duplicate edges, and a rerun with overrideLineage keeps exactly one edge per chart.
  • A dashboard that fails in the connector draws no edges and does not redraw the previous dashboard's.
  • SSRS, with no connector code, gets one edge per report and none for a filtered chart.
  • A workflow run after another in the same process writes back the edges its override run deleted, by id and by name.

Unit tests

  • I added unit tests for the new/changed logic.
  • The dashboard topology tests run the new stage against a fake server that only returns what the bulk sink has flushed: the stage order, the Barrier before the read, one edge per chart, the override flag on every edge, no edge and no error for a dashboard the server does not hold or one without charts, nothing before any dashboard is written, and a failed read reported instead of raised.
  • The lineage client tests run the real lineage mixin against a fake lineage server: an override run in a second client writes back the edge it deleted, by id and by name, and within one client every edge lookup and the graph read after a write still spare a second read.
  • Every changed source line runs under the new unit and integration tests.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • I added/updated ingestion integration tests for connector changes.
  • I ran the integration tests covering my changed files locally (PR CI runs only unit tests, the merge queue runs tests/integration/).
  • A new Tableau dashboard suite fakes the Tableau site at the HTTP transport (REST and Metadata API) and runs the real metadata workflow against a live server, then reads back what the server stored. It covers the use cases above, including two reruns in the same process.
  • The SSRS suite gains a workflow test over its existing fake report server, which shows the same edges come from the shared topology.

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Ran the Tableau and SSRS integration suites against a local development server, before and after the change. Before: both dashboards were ingested with their charts but had no downstream chart edges. After: every case passes.
  2. Reproduced the cache bug with three runs of the Tableau fixture in one process (plain, plain, override). Process wide cache: the override run left the dashboard with no chart edges. Same runs with the cache emptied before the override run, as a fresh process starts: all edges written back. With the per client cache: all edges written back without any clearing.
  3. Ran the dashboard, lineage client, sink and lineage unit suites, plus py_format_check and the static checks.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

  • For UI changes: I attached a screen recording and/or screenshots above.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • The issue properly describes why the new feature is needed, what's the goal, and how we are building it. Any discussion or decision-making process is reflected in the issue.

  • I have updated the documentation.

  • I have added tests around the new logic.

- An override run deletes the edges into an entity and then writes them back, and each write skips the PUT when the edge lookup already finds the edge
- The edge cache was module level, so a later workflow in the same process found an edge its own override run had just deleted and never wrote it back
- The cache now lives on the client, which lasts one workflow, the same span `delete_lineage_by_source` is deduplicated over
- `get_lineage_edge` uses a string key like the other edge lookups
- New `yield_dashboard_chart_lineage` stage right after `yield_dashboard`, so connectors that replace `yield_dashboard_lineage` (Rill) still draw the edges
- After a Barrier it reads the dashboard back with its charts and draws one edge per chart reference, so filtered, failed or rejected charts get none and no chart is fetched on its own
- Edges use the `DashboardLineage` source and carry `overrideLineage` like the other dashboard lineage
- Tableau integration fixture fakes the site at the HTTP transport and runs the workflow against a live server: three charts, a filtered view, a view that fails, a second workbook, a rerun and an override rerun
- SSRS integration test shows the same edges with no connector code
- Each edge lookup (write, by name, by id) and the graph read-back after a write still spare a second read of the same edge within one client
@mohittilala
mohittilala requested a review from a team as a code owner October 9, 2026 05:51
@mohittilala
mohittilala requested review from akashverma0786 and a balanced review from Copilot October 9, 2026 05:51
@mohittilala mohittilala self-assigned this Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 9, 2026

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.

🟢 Approval recommended

No blocking issues were found, and the behavior has focused unit and integration coverage.

0 open findings

What changed in this PR

Adds shared Dashboard → Chart lineage and prevents lineage cache leakage across workflows.

Changes:

  • Adds dashboard-chart lineage after sink flushing.
  • Scopes lineage edge caching per client.
  • Adds unit and live-server integration coverage.
File Description
ingestion/​src/​metadata/​ingestion/​source/​dashboard/​dashboard_service.py Adds shared lineage stage.
ingestion/​src/​metadata/​ingestion/​ometa/​mixins/​lineage_mixin.py Makes edge caching client-scoped.
ingestion/​tests/​unit/​topology/​dashboard/​test_dashboard_chart_lineage.py Tests stage behavior and errors.
ingestion/​tests/​unit/​ometa/​test_lineage_edge_cache.py Tests cache isolation and reuse.
ingestion/​tests/​integration/​tableau/​conftest.py Provides Tableau integration fixtures.
ingestion/​tests/​integration/​tableau/​test_metadata.py Verifies Tableau lineage end-to-end.
ingestion/​tests/​integration/​tableau/​__init__.py Marks the integration-test package.
ingestion/​tests/​integration/​ssrs/​test_metadata.py Verifies shared lineage for SSRS.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -184,6 +184,12 @@ class DashboardServiceTopology(ServiceTopology):
processor="yield_dashboard",

@Khairajani Khairajani Oct 9, 2026 •

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.

dashboard context is never cleared, so if yield_dashboard fails for a dashboard, yield_dashboard_chart_lineage re-reads the previous one and re-emits its edges. Harmless but wasted calls. Can use clear_context=True here would avoid it.

@mohittilala mohittilala Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks @Khairajani! it's addressed now, the dashboard stage now clears its context, with a runner test where the next dashboard fails. this also stops data model lineage and looker usage of a failed dashboard from landing on the previous one.

- A dashboard that failed in the connector left the previous dashboard's name in the context, so the stages after it worked on that dashboard instead
- The chart lineage stage now sees no dashboard and draws nothing, instead of redrawing the previous dashboard's edges
- Data model lineage and Looker lineage and usage for a failed dashboard no longer land on the previous one
@mohittilala mohittilala added the skip-pr-checks Bypass PR metadata validation check label Oct 9, 2026
Copilot AI balanced review requested due to automatic review settings October 9, 2026 07:04
@gitar-bot

gitar-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Adding Dashboard-to-Chart lineage edges and per-client caching changes persisted lineage metadata; incorrect edge handling could leave dependency graphs incomplete or misleading.

Adds a Dashboard to Chart lineage stage to the shared dashboard topology, drawing one edge per chart the server holds under each dashboard, and moves the lineage edge cache onto the ingestion client so override reruns in the same process write back deleted edges. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

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.

🟢 Approval recommended

The implementation addresses both root causes and includes meaningful unit and live-server integration coverage.

0 open findings

🧠 Review effort: Balanced

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@mohittilala
mohittilala added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit f0d254f Oct 9, 2026
75 checks passed
@mohittilala
mohittilala deleted the feat/dashboard-chart-lineage branch October 9, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants