Repository navigation
Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill [Backport #36007 - 2.0] - #36067
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 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.
❌ PR checklist incompleteThis 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 |
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 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 |
|



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_RUNNINGwarning next to data that may be missing whole workbooks. The connector reads data models only from that API and never readerrors. As a result, a workbook the store had not reached yet lost its data models: the run soft-deleted them undermarkDeletedDataModels, 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
ingestion/tests/integration/tableau/test_backfill.py, plus theFakeTableauSitechanges inconftest.pythat it needs. 2.0 has notests/integration/tableau/harness: it came to main with Fixes 5952: [Lineage] Draw Dashboard to Chart edges in the shared dashboard topology #34985 (Dashboard→Chart lineage), which is not on 2.0. The unit tests below cover the same scenario. They run the realTableauClient,TableauSourceand topology runner with onlytableauserverclientand the OpenMetadata client mocked, so on 2.0 nothing checks the effect on a live server.5f19f720031), so the three picks stay as they are, and the rest of the record is unchanged.tableau/client.py: the conflict was on the signature of_query_datasourcesnext to the new method. 2.0 still writes it asOptional[TableauDatasources] # noqa: UP045. That signature keeps 2.0's form, and_query_metadata_apiis main's, unchanged.tableau/metadata.py: the conflict was on thetableau.clientimport, next to main's import oftableau.metrics(Fixes 5989: Ingest Tableau calculated measures as Metric entities #34216, not on 2.0). It resolves to the new import alone.test_tableau_backfill.pyandtest_tableau.pyare byte-identical to Fixes #16038: Stop Tableau ingestion instead of deleting data models during a Metadata API backfill #36007's, and the third commit has the same patch-id as57c01b9cf78.Everything the change relies on is already on 2.0 and behaves as on main:
_run_node_producerrecords a producer's exception, andprocess_nodesthen runs the root node'smark_dashboards_as_deleted,mark_datamodels_as_deletedandmark_charts_as_deletedanyway.DashboardServiceSource.get_dashboardcatches errors per dashboard and moves on.IterStep.runre-raisesWorkflowFatalError, andBaseWorkflow.execute()then stores the pipeline as failed.delete_entity_from_sourcediffers from main's only in type hints.includeDataModelsandmarkDeletedDataModelsare in 2.0'sdashboardServiceMetadataPipeline.json._query_datasourcesandcache_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=srcand CI's pinnedpytest==7.0.1:test_connection.py37,test_dashboard_owned_connection.py5,test_tableau.py53,test_tableau_backfill.py9,test_tableau_client.py13 andtest_tableau_redacted_upstream.py9. I also rantest_source_parsing.py39 andtest_workflow_parse.py16, which parse Tableau configs. 181 passed, 0 failed.client.pyandmetadata.pyput back, 8 of the 9 new tests fail, as on main. The ninth is the complete-store control, which passes._query_metadata_api;extensionsstrictly, or treating any error as a backfill;client.py11/11,metadata.py28/28).tests/unit/topology/dashboard:-n 4 --dist loadfile.test_domodashboard.pyandtest_ssrs.py, which can't importpydomoandrequests_ntlmlocally.createdAtandcreatedBy), 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.ruff checkandruff format --checkpass with 2.0's config. basedpyright (--baselinemode=discard) reports the same findings onclient.pyandmetadata.pyas on untouched 2.0: onlytableauserverclientandvalidators, which I installed outside the venv, show as unresolved imports.Self-review:
94aedb62fb2was reviewed with fresh context against main'sREVIEW.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 in5f19f720031, and a second pass on5f19f720031found nothing.Type of change:
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Stops Tableau ingestion when
BACKFILL_RUNNINGmakes data model deletion unsafe.Review used code inspection; tests were not run.
Acknowledged 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]Reviews (1) · Last reviewed commit: "docs(tableau): drop the integration test..." · Reviewed by Greptile