Repository navigation
fix(tables): keep schemaDefinition when dbt adds a data model [Backport #38285 - 2.1] - #38544
Conversation
(cherry picked from commit 5bd5fa2)
❌ 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 🟡 Medium riskChanging table persistence and source-hash skipping could affect whether stored schema definitions are retained or restored during ingestion. Backports the fix that keeps 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 |
Backport of #38285 (5bd5fa2) to
2.1. Issue: #38427. The 2.0 backport is #38462.What
PUT /v1/tables/{id}/dataModeldeleted the table'sschemaDefinition, 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.addDataModelnow reads the whole stored row before writing it back, so it no longer dropsschemaDefinition.sourceHashskip no longer applies when the stored row lacks aschemaDefinitionthat 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 --stableas 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:
TableResourceIT#put_dataModel_keepsSchemaDefinitionandBulkSourceHashFastPathIT#test_matchingSourceHash_storesSchemaDefinitionTheRowLacksfail on 2.1 without the fix (expected: <CREATE VIEW …> but was: <null>) and pass with it.TableResourceIT,BulkSourceHashFastPathITandTableDataModelCertificationIT: 370 run, 0 failures, 0 errors. The 11 skips are existing assumption checks (CSV support, Redis cache, workflow stages).spotless:checkpasses onopenmetadata-serviceandopenmetadata-integration-tests.Type of change
🤖 Generated with Claude Code