Repository navigation
Fixes #33709: [Ingestion] append source tags when overrideMetadata is off [1.13] - #33710
Conversation
With Overwrite Metadata off, re-ingestion kept the stored tag list for any column that already carried a tag, so a tag added at the source after the first run never landed. Entity level tags went through the positional diff and survived only when the source happened to list them last. Tags are now merged rather than replaced or kept, matching what the server does for a PUT. overrideMetadata=true still replaces them.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
test_topology_patch_table_columns_with_random_order asserted that the source tag is discarded for the table and for column5, which is exactly the behaviour the fix removes. Both now carry the curated tag alongside the source one. The tag assertions also indexed into tags[0]/tags[1], but the server reads tags back with an ORDER BY tagFQN, so the index is a collation artifact once an entity holds more than one tag. They compare sorted FQN lists now.
Code Review ✅ No issues found🟡 Medium risk · Changes ingestion metadata patch semantics to merge tags across entities and nested columns Fixes tag append behavior during re-ingestion when OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
… off [1.13] (#33710) (#33732) * fix(ingestion): append source tags when overrideMetadata is off With Overwrite Metadata off, re-ingestion kept the stored tag list for any column that already carried a tag, so a tag added at the source after the first run never landed. Entity level tags went through the positional diff and survived only when the source happened to list them last. Tags are now merged rather than replaced or kept, matching what the server does for a PUT. overrideMetadata=true still replaces them. * test(ingestion): match the topology patch test to additive tags test_topology_patch_table_columns_with_random_order asserted that the source tag is discarded for the table and for column5, which is exactly the behaviour the fix removes. Both now carry the curated tag alongside the source one. The tag assertions also indexed into tags[0]/tags[1], but the server reads tags back with an ORDER BY tagFQN, so the index is a collation artifact once an entity holds more than one tag. They compare sorted FQN lists now.
… off [1.13] (#33710) (#33755) * fix(ingestion): append source tags when overrideMetadata is off With Overwrite Metadata off, re-ingestion kept the stored tag list for any column that already carried a tag, so a tag added at the source after the first run never landed. Entity level tags went through the positional diff and survived only when the source happened to list them last. Tags are now merged rather than replaced or kept, matching what the server does for a PUT. overrideMetadata=true still replaces them. * test(ingestion): match the topology patch test to additive tags test_topology_patch_table_columns_with_random_order asserted that the source tag is discarded for the table and for column5, which is exactly the behaviour the fix removes. Both now carry the curated tag alongside the source one. The tag assertions also indexed into tags[0]/tags[1], but the server reads tags back with an ORDER BY tagFQN, so the index is a collation artifact once an entity holds more than one tag. They compare sorted FQN lists now.



Describe your changes:
Fixes #33709
1.13 only. On
mainand2.0database entities go through the server's bulk endpoint, where the server already merges tags additively on a PUT. That came with #28155, which is not backportable.What's broken
With Overwrite Metadata off, re-ingestion patches from the ingestion side and only
addoperations survive for the fields inRESTRICT_UPDATE_LIST:_should_update_restricted_fieldkeeps the stored list whenever both sides are non-empty. Right fordescription,ownersanddisplayName, wrong fortags, which are additive.What this changes
tagsare merged rather than replaced or kept whenoverrideMetadatais off, at the entity level and in the column arrays including nestedchildren. Stored tags come first, so the operations stay add-only and survive the existing filter. Tags are deduplicated on(tagFQN, source), the key the server matches on.overrideMetadata=trueis unchanged: the source list still wins, per #32496. Nothing is removed in either direction, so a tag deleted at the source stays.The only caller that passes
restrict_update_fieldsismetadata_rest.patch_entity, so this is scoped to the connector re-ingestion path. Auto-classification writes tags throughpatch_column_tags, a separate path.Verified end to end
On a 1.13 stack against a live Snowflake account, on a column that carries two tags at the source, with Overwrite Metadata off:
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>TestBuildPatchTagAppendiningestion/tests/unit/metadata/ingestion/models/test_patch_request.pycovers the reported case, struct children, unstable source ordering, a tag dropped at the source, a tag added in the UI, theoverrideMetadata=truecontract from #32496, and that an unchanged tag list produces no patch.The PR appears safe to merge; the additive tag behavior and override path are consistently implemented and covered.
Summary
Updates the 1.13 ingestion patch path so source tags are appended to existing entity and column tags when metadata override is disabled.
(tagFQN, source)while retaining stored tags first, producing add-only patch operations.overrideMetadatais enabled.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Stored OpenMetadata tags] --> C{overrideMetadata} B[Tags discovered at source] --> C C -->|false| D[Merge by tagFQN and source] D --> E[Stored tags first] E --> F[Add-only JSON Patch] C -->|true| G[Source tags replace stored tags] F --> H[Entity, column, and nested child tags] G --> HReviews (2) · Last reviewed commit: "test(ingestion): match the topology patc..."