Skip to content

Backport #33710 to 1.13.5: append source tags when overrideMetadata is off - #33732

Merged
mohittilala merged 1 commit into
1.13.5from
backport/33710-to-1.13.5
Sep 21, 2026
Merged

mohittilala merged 1 commit into
1.13.5from
backport/33710-to-1.13.5

Conversation

@mohittilala

@mohittilala mohittilala commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #33710, for #33709.

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. Tags are now merged rather than replaced or kept, which is what the server does for a PUT. overrideMetadata=true still replaces them.

One deliberate difference from the merged commit: the cherry-pick also carries TestBuildPatchTableAliases, which belongs to #33377 and is not on this branch. It asserts "aliases" in ALLOWED_COMMON_PATCH_FIELDS, and 1.13.5 has no aliases entry, so that class is left out. The rest of the change is applied as-is.

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. No schema changes.
  • I have added a test that covers the exact scenario we are fixing.

TestBuildPatchTagAppend in ingestion/tests/unit/metadata/ingestion/models/test_patch_request.py, plus the tag assertions in ingestion/tests/integration/ometa/test_ometa_topology_patch.py, both as merged.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the additive tag behavior is aligned across patch construction, restricted-field filtering, server identity semantics, and regression coverage.

Summary

This backport changes non-override ingestion patches to merge source-provided tags with tags already stored in OpenMetadata instead of silently discarding newly discovered source tags.

  • Adds a shared tag identity and union implementation for entity and nested array fields.
  • Preserves existing replacement behavior when overrideMetadata is enabled.
  • Adds unit coverage for table, column, nested-column, ordering, removal, and override scenarios.
  • Updates topology integration assertions to verify merged tags without relying on database-specific ordering.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Stored[Stored OpenMetadata tags] --> Mode{overrideMetadata?}
  Incoming[Ingested source tags] --> Mode
  Mode -->|No| Merge[Stored-first union by tagFQN and source]
  Mode -->|Yes| Replace[Use incoming tags]
  Merge --> Patch[Build JSON Patch]
  Replace --> Patch
  Patch --> Server[OpenMetadata server]
Loading

Reviews (1) · Last reviewed commit: "Fixes #33709: [Ingestion] append source ..."

… off [1.13] (#33710)

* 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.
@mohittilala
mohittilala requested a review from a team as a code owner September 21, 2026 15:14
@mohittilala mohittilala added the skip-pr-checks Bypass PR metadata validation check label Sep 21, 2026
@mohittilala
mohittilala requested review from ulixius9 and removed request for a team September 21, 2026 15:14
@mohittilala mohittilala self-assigned this Sep 21, 2026
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown
Code Review ✅ No issues found

🟡 Medium risk · Ingestion metadata patching changes tag retention and merge behavior across entities

Backport of tag-merging fix for re-ingestion with overrideMetadata=false. Tags are now merged rather than replaced, allowing source tags added after the first run to be included. overrideMetadata=true behavior unchanged. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@mohittilala
mohittilala enabled auto-merge (squash) September 21, 2026 15:23
@mohittilala
mohittilala merged commit ba931fa into 1.13.5 Sep 21, 2026
131 of 155 checks passed
@mohittilala
mohittilala deleted the backport/33710-to-1.13.5 branch September 21, 2026 15:54
@mohittilala mohittilala mentioned this pull request Sep 21, 2026
1 task done

This branch was previously deployed

1 inactive deployment
test — 361f412b Deployed Sep 21, 2026 by mohittilala via playwright-ci-postgresql (6, 6) #91182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant