Repository navigation
Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill - #36007
Merged
Conversation
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
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.
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.
harshsoni2024
requested review from
Khairajani
and
a balanced review from Copilot
October 22, 2026 18:15
Code Review ✅ Approved🔴 High risk · Changing Tableau backfill reconciliation can preserve stale data models or, with deletion disabled, unlink dashboards from models omitted by partial results. Tableau connector now stops instead of deleting data models while the Metadata API is still rebuilding its store (BACKFILL_RUNNING), and fails the run with a re-run message when markDeletedDataModels is on. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
harshsoni2024
enabled auto-merge
October 23, 2026 05:40
1 task done
TeddyCr
approved these changes
Oct 23, 2026
harshsoni2024
added this pull request to the merge queue
Oct 23, 2026
harshsoni2024
added a commit
that referenced
this pull request
Oct 24, 2026
Closed
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes:
Fixes #16038
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_RUNNINGwarning next to data that may be missing whole workbooks. The connector never readerrors, and it reads data models only from that API. A workbook the store had not reached yet therefore lost its data models: the run soft-deleted them undermarkDeletedDataModels, re-sent the dashboard 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 with a message to re-run after the backfill or to turn off
markDeletedDataModels. With that off, it ingests the partial results and warns; the issue asks for the error only when deletion is on. Reproduced onmainend to end against a live server (see Manual testing).Type of change:
High-level design:
_query_datasourcesandcache_custom_sql_tables) go throughTableauClient._query_metadata_api. It setsmetadata_api_backfill_runningwhen anyerrors[].extensions.codeisBACKFILL_RUNNING, logs it once, and returns the data unchanged.tableauserverclientonly raises onerrorswithabort_on_error=True. The test connection borrows the same client, so a backfill it sees carries into the run.TopologyRunnerMixin._run_node_producerrecords a producer's exception, and the root node'spost_process(mark_{dashboards,datamodels,charts}_as_deleted) then runs anyway, against a listing cut short.get_dashboardalso catches per-dashboard exceptions, which would skip a dashboard and then soft-delete it. The earlier attempt in Detect Tableau BACKFILL_RUNNING errors and abort ingestion when markDeletedDashboards is enabled #25032 raised inside_query_datasources' ownexcept Exception, so it never stopped a run.includeDataModels and markDeletedDataModels(TableauSource._stops_for_backfill). The issue asks to fail whenmarkDeletedDashboardsis on. However, workbooks and views come from the REST API and stay complete during a backfill, somarkDeletedDashboardsandmarkDeletedChartscannot delete anything because of it. What a partial listing deletes is data models, undermarkDeletedDataModels. With data models off, none are reconciled, so there is nothing to protect.DashboardUpdaterreplaces a dashboard'sdataModelslinks with the ones sent, so a run that carried on would still unlink the data models the store has not reached.TableauSource.get_dashboardstops producing at the first dashboard read after the warning, including the one whose data sources revealed it. The dashboard and chart listings stop there too, so all threemark_*_as_deletedsteps are skipped.successThresholdis. Every record the run sent succeeded, soTableauSource._iterraisesWorkflowFatalErroronce the topology is done. It also records aTableau Metadata APIfailure, so the run summary shows the reason.IterStep.runre-raises it andexecute()stores the pipeline as failed. This is REVIEW.md's "Failed or partial discovery never drives deletion".markDeletedDataModelsoff, a dashboard whose workbook the store has not reached is still sent without its data models, so it loses those links until a run after the backfill. The fatal message says so, and the integration test pins it. Keeping the stored links for such a dashboard is possible, but it is a further behavior change and is left for a follow-up.NODE_LIMIT_EXCEEDED,TIME_LIMIT_EXCEEDED) and failed data-source queries (the broadexceptinget_datasources) still turn into short listings. Unlike a backfill they can recur on every run for one large workbook, so stopping and failing would block that site for good; they need a guard of their own. Recorded in ADR:2026-10-22-tableau-runs-stop-without-deleting-while-the-metadata-api-backfills.Tests:
Use cases covered
BACKFILL_RUNNING(the payload from the issue) is recorded and its data still returned, from the data-source query and from the custom SQL query a run opens with.deleteStalerequest, and the run raisesWorkflowFatalErrornamingBACKFILL_RUNNINGandmarkDeletedDataModels, with oneTableau Metadata APIfailure.markDeletedDataModelsoff, orincludeDataModelsoff: every dashboard and chart and the partial data models are ingested, dashboards and charts are still reconciled, and the run ends with one warning and no failure.Unit tests
ingestion/tests/unit/topology/dashboard/test_tableau_backfill.py(9 tests). It runs the realTableauClientandTableauSourcethroughSource.run(), the workflow's entrypoint and the real topology runner, with onlytableauserverclient(Pager,metadata.query) and the OpenMetadata client mocked.test_tableau.py. Its stub client gainsmetadata_api_backfill_running=False, sinceget_dashboardnow reads it.PYTHONPATH=src:test_connection.py37,test_dashboard_owned_connection.py5,test_tableau.py53,test_tableau_backfill.py9,test_tableau_client.py13,test_tableau_metrics.py16,test_tableau_redacted_upstream.py9: 142 passed, 0 failed.pytest-cov): every changed executable line is covered, 39/39 (metadata.py28/28,client.py11/11). File totals areclient.py74% andmetadata.py71%; the rest is untouched lineage and column code.main, 8 of the 9 new tests fail; the complete-store control passes. Each guard was also checked to fail when swapped out in-process: the producer stop, each of the three skipped deletions, the fatal error, theincludeDataModelspart of the gate, matching only theBACKFILL_RUNNINGcode, and reading an error withoutextensions.ruff check,ruff format --checkandscripts/check_ruff_suppressions.py --checkare clean. basedpyright (--baselinemode=discard) reports the same findings onclient.pyandmetadata.pyas onmain.Backend integration tests
Ingestion integration tests
tests/integration/).ingestion/tests/integration/tableau/test_backfill.py(2 tests). It uses the existing harness that fakes Tableau at the HTTP transport;FakeTableauSitegains optional data sources, a backfill flag and not-yet-indexed workbooks, and its defaults keep the existing responses. The realMetadataWorkflowwrites to a live server, and the assertions read back the data model and the dashboard's links. Each run resetsDashboardServiceSource's seen-entity sets, as a scheduled run's fresh process does: they are class attributes, so two runs in one process would share them.tests/integration/tableau/8 passed,tests/integration/tags/test_dashboard_stages.py8 passed, 16 passed. Onmain, both new tests fail (DID NOT RAISE WorkflowFatalError; no warning).Playwright (UI) tests
Manual testing performed
No Tableau site with a running backfill was available, since Tableau only runs one after the Metadata API is enabled or upgraded. The scenario was replayed with the issue's GraphQL payload through the integration harness above:
tableauserverclient, the connector and the workflow ran unmodified against a local server.Sales,Ops), each with one data source. Both data models were ingested and linked to their dashboards.BACKFILL_RUNNINGand the store missingOps, with fresh source state as a scheduled run has.main: the run reported success with no warning. TheOpsdata model was soft-deleted on the server (deleted: true), and theOpsdashboard'sdataModelsbecame[].WorkflowFatalError: Tableau's Metadata API is still building its store (BACKFILL_RUNNING), so its results may be incomplete. The run stopped there and marked nothing as deleted: with markDeletedDataModels on, it would soft-delete data models that still exist in Tableau. Re-run once the backfill completes. To ingest meanwhile, turn off markDeletedDataModels; dashboards then lose their links to the data models the store has not reached, until a run after the backfill.NodeleteStalerequest was sent, and the data model stayed live and linked.markDeletedDataModels: false: the run succeeded with the warningTableau's Metadata API is still building its store (BACKFILL_RUNNING), so data models, their links to dashboards and lineage ingested in this run may be incomplete. Re-run once the backfill completes.Dashboards and charts were reconciled and data models were not. TheOpsdata model stayed live, and theOpsdashboard lost its link to it, as the fatal message warns.UI screen recording:
Not applicable — ingestion-only change.
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. Not applicable: no schema change.
For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). Not applicable: ingestion-only change.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Pass 1 on
6911f5ee5ab: no 🔴. 🟡 the fatal message offered turning offmarkDeletedDataModelswithout saying that dashboards then lose their links to the data models the store has not reached: the message now says so, and the integration test pins it. 🟡 a chart assertion that could never fail: each fake workbook now has a view. 🟡 history narration in a test docstring, and "as Bug - Tableau Ingestion must throw an error when there are errors with code= BACKFILL_RUNNING #16038 asked" in the record: reworded. 🟡 per-query partial-result warnings and failed data-source reads still shorten listings: pre-existing and out of scope; the record now says why they need a guard of their own. Fixed in11133678e60. Pass 2 on11133678e60: no 🔴. 🟡 the test for an error withoutextensionschecked only the flag, so readingextensionsstrictly, which empties the listing, still passed: fixed in57c01b9cf78, a test-only change that the same mutant now fails. 🟡 an unknown read is still written as "no data models" (pass 1's last two findings again), and 🟡 the TableauPipeline connector reads the same Metadata API without a backfill check: both pre-existing and outside this diff, left for follow-ups; no issues filed yet.Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under
docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.Added ADR:2026-10-22-tableau-runs-stop-without-deleting-while-the-metadata-api-backfills.
I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issue was found.Summary
The Tableau connector now detects
BACKFILL_RUNNINGand stops runs that reconcile data models before incomplete results can remove models or dashboard links.Acknowledged by harshsoni2024:
markDeletedDataModelsis off; preserving them is intentionally deferred.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 before dashboard write stages] F --> G[Skip all three deletion steps] G --> H[Raise WorkflowFatalError] E -- No --> I[Ingest returned data and record warning]Reviews (1) · Last reviewed commit: "test(tableau): assert the data survives ..." · Reviewed by Greptile