Skip to content

Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill [Backport #36007 - 2.0] - #36067

Merged
harshsoni2024 merged 4 commits into
2.0from
backport-36007-2.0
Oct 24, 2026
Merged

harshsoni2024 merged 4 commits into
2.0from
backport-36007-2.0

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #36007 to 2.0. It picks the PR's three commits (6911f5ee5ab, 11133678e60, 57c01b9cf78) and fixes #16038 on 2.0. #36007 is still open, so any change made to it in review needs picking here too.

While Tableau rebuilds the store behind its Metadata API (after the API is enabled and after upgrades, for up to a week), every GraphQL response carries a BACKFILL_RUNNING warning next to data that may be missing whole workbooks. The connector reads data models only from that API and never read errors. As a result, a workbook the store had not reached yet lost its data models: the run soft-deleted them under markDeletedDataModels, sent the dashboard again without them, which unlinks them on the server, and reported success.

A run that reconciles data models now stops when Tableau reports the backfill, deletes nothing, and fails. Its message says to re-run after the backfill or to turn off markDeletedDataModels. With that setting off, the run ingests the partial results and ends with a warning. #36007 explains the design, and the ADR it adds records it.

Differences from #36007

Everything the change relies on is already on 2.0 and behaves as on main:

  • _run_node_producer records a producer's exception, and process_nodes then runs the root node's mark_dashboards_as_deleted, mark_datamodels_as_deleted and mark_charts_as_deleted anyway.
  • DashboardServiceSource.get_dashboard catches errors per dashboard and moves on.
  • IterStep.run re-raises WorkflowFatalError, and BaseWorkflow.execute() then stores the pipeline as failed.
  • delete_entity_from_source differs from main's only in type hints.
  • includeDataModels and markDeletedDataModels are in 2.0's dashboardServiceMetadataPipeline.json.
  • 2.0 calls the Metadata API from the same two places as main (_query_datasources and cache_custom_sql_tables), and both now go through the new _query_metadata_api.

Tests

Run locally on this branch, with 2.0's own generated models, PYTHONPATH=src and CI's pinned pytest==7.0.1:

  • Unit tests covering the changed files. These are the changed tests plus every test importing a changed module: test_connection.py 37, test_dashboard_owned_connection.py 5, test_tableau.py 53, test_tableau_backfill.py 9, test_tableau_client.py 13 and test_tableau_redacted_upstream.py 9. I also ran test_source_parsing.py 39 and test_workflow_parse.py 16, which parse Tableau configs. 181 passed, 0 failed.
  • Fail without the fix. With 2.0's original client.py and metadata.py put back, 8 of the 9 new tests fail, as on main. The ninth is the complete-store control, which passes.
  • Mutations. I made 15 single-line mutations of the fix, and each one fails at least one test:
    • removing the producer stop, the raise, the recorded failure or the warning;
    • removing any one of the three skipped deletions;
    • dropping either half of the gate;
    • sending either query around _query_metadata_api;
    • reading extensions strictly, or treating any error as a backfill;
    • stopping only after the dashboard that revealed the backfill;
    • never setting the backfill flag.
  • Coverage. Every changed executable line is covered, 39 of 39 (client.py 11/11, metadata.py 28/28).
  • Whole dashboard suite. 2.0 still shares one topology context across dashboard sources, so I also ran all of tests/unit/topology/dashboard:
    • In one process, 668 passed on this branch and 659 on untouched 2.0, with 0 failed on both. This branch also gives 668 passed with -n 4 --dist loadfile.
    • The 2 errors on both are test_domodashboard.py and test_ssrs.py, which can't import pydomo and requests_ntlm locally.
    • The new file also passes before and after each of the other Tableau test files.
    • The venv's pytest 9.1.1 gives the same 17 failures in this suite on this branch and on untouched 2.0, which 7.0.1 does not.
  • Integration. No integration test on 2.0 imports the changed modules, and the Tableau one is left out (above). I also tried running Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill #36007's integration test from this branch against my local server. That server is a main build, and 2.0's models reject its data models (main's createdAt and createdBy), so the run failed in setup for that reason alone. The end-to-end evidence is Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill #36007's run on main.
  • Static checks. ruff check and ruff format --check pass with 2.0's config. basedpyright (--baselinemode=discard) reports the same findings on client.py and metadata.py as on untouched 2.0: only tableauserverclient and validators, which I installed outside the venv, show as unresolved imports.

Self-review: 94aedb62fb2 was reviewed with fresh context against main's REVIEW.md (2.0 has none). The review focused on what can differ on 2.0: the dashboard base class, topology runner, step and workflow error handling, stale deletion, the Tableau client and source, and the test fixtures and patch targets. It found no 🔴. Its one 🟡 was that the ADR's Guard line named the integration test this backport leaves out; that is fixed in 5f19f720031, and a second pass on 5f19f720031 found nothing.

Type of change:

  • Bug fix

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Stops Tableau ingestion when BACKFILL_RUNNING makes data model deletion unsafe.

  • Tableau runs stop before partial results can remove live metadata.

Review used code inspection; tests were not run.

Acknowledged limits:

  • harshsoni2024 explicitly deferred guards for other partial-result warnings in the ADR because they need a different guard.
  • harshsoni2024 explicitly acknowledged the omitted integration test and the backport’s test limits.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Metadata API response] --> B{BACKFILL_RUNNING?}
  B -->|No| C[Continue normally]
  B -->|Yes| D[Remember backfill for this run]
  D --> E{includeDataModels and markDeletedDataModels?}
  E -->|Yes| F[Stop producing dashboards]
  F --> G[Skip all three stale-deletion steps]
  G --> H[Raise WorkflowFatalError]
  E -->|No| I[Ingest partial results]
  I --> J[Record a status warning]
Loading

Reviews (1) · Last reviewed commit: "docs(tableau): drop the integration test..." · Reviewed by Greptile

While Tableau rebuilds the store behind its Metadata API, every GraphQL
response carries a BACKFILL_RUNNING warning next to data that may be
missing whole workbooks. Data models are read only from that API, so a
workbook the store had not reached yet lost its data models: the run
soft-deleted them under markDeletedDataModels and re-sent the dashboard
without them, unlinking them on the server.

The client now reads that warning on every Metadata API response. When
the run reconciles data models, the source stops producing dashboards,
skips the markDeleted* steps and fails with WorkflowFatalError once the
topology is done, since the runner reconciles even after a producer
raises. Otherwise the partial results are ingested with a status warning.

Fixes #16038

Backport to 2.0: leaves out the Tableau integration test and its
conftest.py changes. 2.0 has no tests/integration/tableau harness; it
came to main with #34985.

(cherry picked from commit 6911f5e)
The fatal message offered turning off markDeletedDataModels without
saying that dashboards then lose their links to the data models the
store has not reached. It now says so, the warning names the links too,
and the integration test pins the cost. Each fake workbook in the unit
tests gets a view, so the chart assertions can fail. The decision record
says why per-query partial results need a guard of their own, and no
longer overstates what #16038 asked.

Backport to 2.0: leaves out the integration test change, as the
previous commit leaves out the test.

(cherry picked from commit 1113367)
Reading an error's extensions strictly would raise inside
_query_datasources, whose catch turns the workbook's data sources into an
empty listing, while every test still passed. The test now checks the
data sources come back.

(cherry picked from commit 57c01b9)
The decision record names the Tableau backfill integration test as a
guard, but 2.0 has no tests/integration/tableau harness (it came to
main with #34985). The backport leaves that test out, so on 2.0 the
record names only the unit tests.
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner October 23, 2026 07:33
@harshsoni2024
harshsoni2024 removed the request for review from a team October 23, 2026 07:33
@harshsoni2024 harshsoni2024 added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 23, 2026
@harshsoni2024 harshsoni2024 added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 23, 2026
@github-actions

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.

@gitar-bot

gitar-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Tableau backfill detection changes stale-entity reconciliation; partial ingestion without data-model deletion could leave dashboard links missing until a complete run.

Backports the Tableau backfill fix to 2.0: ingestion now stops instead of soft-deleting data models when the Metadata API reports BACKFILL_RUNNING, with a clear failure message or a warning when markDeletedDataModels is off. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@sonarqubecloud

Copy link
Copy Markdown

@harshsoni2024
harshsoni2024 merged commit 7bec646 into 2.0 Oct 24, 2026
122 of 153 checks passed
@harshsoni2024
harshsoni2024 deleted the backport-36007-2.0 branch October 24, 2026 06:56

This branch was previously deployed

1 inactive deployment
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants