Skip to content

fix(tables): keep schemaDefinition when dbt adds a data model [Backport #38285 - 2.1] - #38544

Merged
harshsoni2024 merged 1 commit into
2.1from
backport-38285-2.1
Nov 24, 2026
Merged

harshsoni2024 merged 1 commit into
2.1from
backport-38285-2.1

Conversation

@harshsoni2024

Copy link
Copy Markdown
Contributor

Backport of #38285 (5bd5fa2) to 2.1. Issue: #38427. The 2.0 backport is #38462.

What

PUT /v1/tables/{id}/dataModel deleted the table's schemaDefinition, and later metadata ingestion runs never brought it back. dbt ingestion calls this endpoint for every dbt model and source it matches to a table. #38285 has the full description.

  • TableRepository.addDataModel now reads the whole stored row before writing it back, so it no longer drops schemaDefinition.
  • The bulk sourceHash skip no longer applies when the stored row lacks a schemaDefinition that the request carries. The next ingestion run therefore restores the definitions that were already deleted.

Differences from the main commit

None. The pick applied cleanly and has the same git patch-id --stable as 5bd5fa2. Every method and test helper it uses exists on 2.1 with the same signature.

Tests

PR CI on 2.1 does not run the Java integration tests (they run in the merge queue), so these were run locally on this branch, on MySQL + Elasticsearch in the parallel lane:

  • New tests: TableResourceIT#put_dataModel_keepsSchemaDefinition and BulkSourceHashFastPathIT#test_matchingSourceHash_storesSchemaDefinitionTheRowLacks fail on 2.1 without the fix (expected: <CREATE VIEW …> but was: <null>) and pass with it.
  • Full classes: TableResourceIT, BulkSourceHashFastPathIT and TableDataModelCertificationIT: 370 run, 0 failures, 0 errors. The 11 skips are existing assumption checks (CSV support, Redis cache, workflow stages).
  • spotless:check passes on openmetadata-service and openmetadata-integration-tests.
  • The Docker replay of the dbt and metadata agents' requests, using the released 2.0.8 ingestion client, was not repeated on 2.1. It ran against fix(tables): keep schemaDefinition when dbt adds a data model #38285's build, and against fix(tables): keep schemaDefinition when dbt adds a data model [Backport #38285 - 2.0] #38462's build as an in-place upgrade from 2.0.8. This branch makes the same change to the same code.

Type of change

  • Bug fix

🤖 Generated with Claude Code

@harshsoni2024
harshsoni2024 requested a review from a team as a code owner November 24, 2026 05:36
@harshsoni2024
harshsoni2024 requested review from yan-3005 and removed request for a team November 24, 2026 05:36
@harshsoni2024 harshsoni2024 added the safe to test Add this label to run secure Github workflows on PRs label Nov 24, 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 Nov 24, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Changing table persistence and source-hash skipping could affect whether stored schema definitions are retained or restored during ingestion.

Backports the fix that keeps schemaDefinition when dbt adds a data model, by having TableRepository.addDataModel read the full stored row before writing and by skipping the bulk sourceHash fast path when the stored row lacks a schemaDefinition the request carries. 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

@harshsoni2024
harshsoni2024 merged commit fd67747 into 2.1 Nov 24, 2026
44 of 45 checks passed
@harshsoni2024
harshsoni2024 deleted the backport-38285-2.1 branch November 24, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant