Skip to content

Detect Tableau BACKFILL_RUNNING errors and abort ingestion when markDeletedDashboards is enabled - #25032

Closed
ulixius9 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-tableau-ingestion-errors
Closed

ulixius9 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-tableau-ingestion-errors

Conversation

Copilot AI commented Jan 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

During Tableau's quarterly metadata backfill (which can last up to a week), GraphQL queries return incomplete data with code: "BACKFILL_RUNNING". Running ingestion with markDeletedDashboards: true during this period causes valid dashboards and data models to be incorrectly marked as deleted, breaking lineage and losing metadata.

Changes:

  • Added TableauBackfillRunningException - New exception class for backfill state detection
  • Added _check_backfill_running_error() - Inspects GraphQL responses for BACKFILL_RUNNING error code in extensions.code
  • Integrated detection into _query_datasources() and cache_custom_sql_tables() GraphQL query methods
  • Configuration-aware behavior:
    • markDeletedDashboards=true: Raises exception, aborts ingestion with clear error message
    • markDeletedDashboards=false: Logs warning, continues with incomplete data
  • Config pass-through in TableauSource.__init__ to propagate markDeletedDashboards setting to client

Example GraphQL response with BACKFILL_RUNNING:

{
  "errors": [
    {
      "message": "Still creating the Metadata API Store. Results might be incomplete.",
      "extensions": {
        "severity": "WARNING",
        "code": "BACKFILL_RUNNING"
      }
    }
  ],
  "data": { "workbooks": [] }
}

Result:

# Before: Silent data loss - incomplete results processed as complete
# After: Clear abort with actionable message
TableauBackfillRunningException: Tableau Metadata API is in backfill mode (BACKFILL_RUNNING).
Ingestion aborted because 'markDeletedDashboards' is set to True.
Running ingestion during backfill could result in incorrect deletion of metadata.
Please wait for Tableau backfill to complete and retry.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.

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

  • 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.

  • 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.

Original prompt

This section details on the original issue you should resolve

<issue_title>Bug - Tableau Ingestion must throw an error when there are errors with code= BACKFILL_RUNNING</issue_title>
<issue_description>Affected module
Ingestion

Describe the bug
When tableau metadata store is in backfilling mode, it could happen that data models and dashboards are removed and marked as deleted if markDeletedDashboards: false. This could lead to various issues:

  • broken lineage
  • missing data models
  • missing dashboards

To Reproduce
It's hard to reproduce, as it depends on tableau cloud running quarterly, and based on tableau instance it can take a week.

Expected behavior
When the API or grapql is result contains:

{
  "errors": [
    {
      "message": "Still creating the Metadata API Store. Results from the query might be incomplete at this time.",
      "extensions": {
        "severity": "WARNING",
        "code": "BACKFILL_RUNNING"
      }
    }
  ],
  "data": {
    ....
  }
}

When errors contains code=BACKFILL_RUNNING I would like to have the ingestion throwing an error if markDeletedDashboards=True to avoid to have unexpected behaviours like relevant metadata removed from OM.

Version:

  • OS: Linux
  • Python version: 3.11
  • OpenMetadata version: 1.3.2
  • OpenMetadata Ingestion package version: 1.3.2.0

Additional context
As a workaround I implemented the check above in my ingestion pipeline to avoid unexpected in the future.</issue_description>

<agent_instructions>break the ingestion when BACKFILL_RUNNING is returned while executing graphql queries in tableau </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 5, 2026 10:08
- Add TableauBackfillRunningException to handle backfill errors
- Add _check_backfill_running_error() method to detect errors in GraphQL responses
- Integrate error checking into _query_datasources() and cache_custom_sql_tables()
- Pass markDeletedDashboards config to TableauClient
- Raise exception when BACKFILL_RUNNING detected with markDeletedDashboards=True
- Log warning when BACKFILL_RUNNING detected with markDeletedDashboards=False
- Add comprehensive unit tests for BACKFILL_RUNNING detection

Co-authored-by: ulixius9 <[email protected]>
Copilot AI changed the title [WIP] Fix Tableau ingestion to throw error when backfilling Detect Tableau BACKFILL_RUNNING errors and abort ingestion when markDeletedDashboards is enabled Jan 5, 2026
Copilot AI requested a review from ulixius9 January 5, 2026 10:12
@gitar-bot

gitar-bot Bot commented Jan 5, 2026 •

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 2 findings

Good defensive feature to prevent incorrect metadata deletion during Tableau backfill, with minor initialization and coverage concerns.

⚠️ Edge Case: Initialization timing issue with mark_deleted_dashboards

📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py:117-118

The mark_deleted_dashboards attribute is set after super().__init__() is called, but the client is created in the parent class's __init__. This means the client may already be created with the default value (False) before this code executes.

While the current implementation works because the attribute is checked at runtime during GraphQL calls (not at construction time), this is fragile and unintuitive. If the parent's __init__ were to make GraphQL calls, the flag would still be False.

Suggested fix: Pass mark_deleted_dashboards during client construction in the parent class, or ensure the create() method provides the parameter when constructing the client. This would make the configuration flow clearer and more robust.

💡 Edge Case: BACKFILL_RUNNING check only added to 2 GraphQL methods

📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py:383-389 📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py:463-464

The _check_backfill_running_error() check is only added to get_all_datasources and the custom SQL tables query method. However, if the Tableau client has other methods that make GraphQL queries (e.g., queries for workbooks, sheets, or other metadata), those would not have this protection.

If Tableau returns BACKFILL_RUNNING for any GraphQL query, incomplete data could still be processed in other methods.

Suggestion: Audit all GraphQL query methods in the client to ensure consistent backfill error checking, or consider creating a wrapper method for GraphQL execution that automatically includes this check.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@TeddyCr TeddyCr closed this Feb 20, 2026
Comment on lines 117 to +118
self.today = datetime.now().strftime("%Y-%m-%d")
# Pass markDeletedDashboards config to the client

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Edge Case: Initialization timing issue with mark_deleted_dashboards

The mark_deleted_dashboards attribute is set after super().__init__() is called, but the client is created in the parent class's __init__. This means the client may already be created with the default value (False) before this code executes.

While the current implementation works because the attribute is checked at runtime during GraphQL calls (not at construction time), this is fragile and unintuitive. If the parent's __init__ were to make GraphQL calls, the flag would still be False.

Suggested fix: Pass mark_deleted_dashboards during client construction in the parent class, or ensure the create() method provides the parameter when constructing the client. This would make the configuration flow clearer and more robust.

Was this helpful? React with 👍 / 👎

Comment on lines 383 to +389
workbook_id=dashboard_id, first=entities_per_page, offset=offset
)
)

# Check for BACKFILL_RUNNING error in GraphQL response
self._check_backfill_running_error(datasources_graphql_result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Edge Case: BACKFILL_RUNNING check only added to 2 GraphQL methods

The _check_backfill_running_error() check is only added to get_all_datasources and the custom SQL tables query method. However, if the Tableau client has other methods that make GraphQL queries (e.g., queries for workbooks, sheets, or other metadata), those would not have this protection.

If Tableau returns BACKFILL_RUNNING for any GraphQL query, incomplete data could still be processed in other methods.

Suggestion: Audit all GraphQL query methods in the client to ensure consistent backfill error checking, or consider creating a wrapper method for GraphQL execution that automatically includes this check.

Was this helpful? React with 👍 / 👎

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.

Bug - Tableau Ingestion must throw an error when there are errors with code= BACKFILL_RUNNING

3 participants