Repository navigation
fix(backend): column description updation with overrideMetadata=true - #31543
Conversation
…a on columns Trino's SHOW COLUMNS reports an unset column comment as the empty string rather than NULL, and reports an explicit COMMENT '' the same way. _get_columns passed that through unchanged, so uncommented columns were ingested with description: "" instead of no description. Normalize '' to None so the sink's exclude_none drops the field, and apply the same normalization to the table comment. Separately, ColumnEntityUpdater.updateColumnDescription and updateColumnDisplayName ignored the overrideMetadata flag that the entity-level updateDescription already honors, so a bot PUT always reverted a non-empty column description and a changed source comment could never reach an existing column. Both now check !overrideMetadata; the field moves from private to protected so the ColumnEntityUpdater subclass can read it. The two defects masked each other: a column stored as "" is nullOrEmpty, so its first comment landed and the sync appeared to work until a second update to an already-described column was dropped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
✅ Playwright Results — workflow succeededValidated commit ✅ 551 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 33s ⏱️ Max setup 3m 12s · max shard execution 19m 10s · max shard-job elapsed before upload 22m 22s · reporting 5s 🌐 214.06 requests/attempt · 2.83 app boots/UI scenario · 10.78% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
overrideMetadata now lets ingestion replace a non-empty column description but never clear it. A connector that finds no comment on the column omits the field entirely, so an override run would otherwise read that absence as a deletion and wipe curated text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The connector-side normalization of Trino's empty column comments is unrelated to the backend column-merge fix and reviews independently, so it now lives on trino_empty_column_comment_fix. This branch keeps only the EntityRepository change and its integration tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
updateColumnDisplayName intentionally has no overrideMetadata term: connectors rarely send a column displayName, so honouring the flag there would blank curated values on nearly every override run. The test asserted the opposite and would have failed CI. Assert instead that the curated displayName survives, so the asymmetry with the description path is pinned rather than accidental. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🚦 Removed from the merge queue —
|
Code Review ✅ ApprovedUpdates column-level description merging during bulk ingestion to respect the overrideMetadata flag while preventing empty values from blanking existing descriptions. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…31543) * fix(trino): normalize empty column comments and honor overrideMetadata on columns Trino's SHOW COLUMNS reports an unset column comment as the empty string rather than NULL, and reports an explicit COMMENT '' the same way. _get_columns passed that through unchanged, so uncommented columns were ingested with description: "" instead of no description. Normalize '' to None so the sink's exclude_none drops the field, and apply the same normalization to the table comment. Separately, ColumnEntityUpdater.updateColumnDescription and updateColumnDisplayName ignored the overrideMetadata flag that the entity-level updateDescription already honors, so a bot PUT always reverted a non-empty column description and a changed source comment could never reach an existing column. Both now check !overrideMetadata; the field moves from private to protected so the ColumnEntityUpdater subclass can read it. The two defects masked each other: a column stored as "" is nullOrEmpty, so its first comment landed and the sync appeared to work until a second update to an already-described column was dropped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(service): don't blank a column description on overrideMetadata runs overrideMetadata now lets ingestion replace a non-empty column description but never clear it. A connector that finds no comment on the column omits the field entirely, so an override run would otherwise read that absence as a deletion and wipe curated text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * revert(trino): move the empty column comment fix to its own branch The connector-side normalization of Trino's empty column comments is unrelated to the backend column-merge fix and reviews independently, so it now lives on trino_empty_column_comment_fix. This branch keeps only the EntityRepository change and its integration tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * test(it): pin that overrideMetadata does not touch a column displayName updateColumnDisplayName intentionally has no overrideMetadata term: connectors rarely send a column displayName, so honouring the flag there would blank curated values on nearly every override run. The test asserted the opposite and would have failed CI. Assert instead that the curated displayName survives, so the asymmetry with the description path is pinned rather than accidental. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: IceS2 <pablo.takara@getcollate.io>
Describe your changes:
Fixes #31544
I worked on the backend half of #31544: once a table column had a non-empty
description, ingestion could never update it again, even with
overrideMetadata: true.The entity-level
updateDescription()inEntityRepositoryconsults theoverrideMetadataflag that the bulk path sets fromPUT /v1/tables/bulk?overrideMetadata=true. The column-levelupdateColumnDescription()did not — it unconditionally reverted a bot PUTwhenever the stored column description was non-empty, so a changed source
comment could never reach an existing column.
updateColumnDescription()nowconsults the flag, matching the entity-level behaviour.
The guard keeps one condition that the entity-level version does not:
overrideMetadatamay replace a column description but never blank it.A connector that finds no comment on a column omits the field from the payload
entirely, so the incoming description arrives as
null. Without that clause, anoverride run would read the absence as a deletion and wipe hand-written column
documentation on every uncommented column. Clearing a column description
therefore still requires a PATCH (UI edit or API) — ingestion is replace-only.
overrideMetadatadeliberately does not extend to the columndisplayName.Connectors rarely send one, so honouring the flag there would blank curated
column display names on nearly every override run.
updateColumnDisplayName()isleft as-is and covered by a test that pins that asymmetry.
The
overrideMetadatafield moves fromprivatetoprotectedbecauseColumnEntityUpdateris a subclass ofEntityUpdaterand a private superclassfield does not resolve by simple name.
Companion PR: the connector-side half of #31544 (Trino reporting an unset
column comment as
'', so uncommented columns were ingested withdescription: "") is on branchtrino_empty_column_comment_fixand shipsseparately. Both are needed to close the issue: this PR lets an updated comment
reach an already-described column, and the connector PR stops blank descriptions
being written in the first place.
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
overrideMetadata: truepropagates an updated sourcecomment onto a column that already has a non-empty description
overrideMetadatastill preserves auser-curated column description (no regression to the existing protection)
overrideMetadatarun that supplies no description for a column does notblank the stored one
displayNamesurvives anoverrideMetadatarunUnit tests
endpoint, exercised end-to-end by the integration tests below rather than by a
unit test.
EntityUpdateris an inner class reached through the repository, soa unit test here would assert mock wiring rather than behaviour.
Backend integration tests
openmetadata-integration-tests/.openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BulkOverrideMetadataIT.java— four column-level cases alongside the existing table-level ones:
test_botCannotOverwriteColumnDescription_withoutOverridetest_botOverwritesColumnDescription_withOverridetest_overrideDoesNotBlankColumnDescriptiontest_columnDisplayNamePreserved_evenWithOverrideIngestion integration tests
Playwright (UI) tests
Manual testing performed
Local Trino (
memorycatalog) against a locally built OpenMetadata stack, withoverrideMetadata: truein the ingestion config. The companion connector fix wasalso applied locally, since reproducing the original report end to end needs
both.
memory.default.fruitswith apricecolumn carrying the comment'price of fruit'. Ran ingestion; OpenMetadata showedprice → 'price of fruit'.overrideMetadata: trueagainst the existingservice. Before this change,
pricekept the stale'price of fruit'.were correct there — that path is an insert, so no merge guard runs. This
confirmed the loss was in the server-side column merge, not in extraction.
service:
pricenow updates to'second comment on fruit type'.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #31544above.Greptile Summary
This PR allows bot-driven bulk ingestion with
overrideMetadata=trueto replace existing column descriptions while preserving them when the incoming description is absent or empty.Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or non-blocking defects identified.
The override flag is set on a fresh updater for each bulk entity, remains disabled on ordinary PUTs, and the revised guard preserves existing descriptions for absent or empty incoming values while permitting explicit non-empty replacements.
Important Files Changed
Reviews (1): Last reviewed commit: "test(it): pin that overrideMetadata does..." | Re-trigger Greptile