Repository navigation
Fixes 33374: allow Table.aliases through the entity patch [1.13] - #33377
Conversation
❌ 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 |
| # Source-managed: the connector recomputes it every run, so the patch has to be | ||
| # able to add, replace and remove it. Omitting it here silently drops synonyms | ||
| # on every table that already exists in OpenMetadata. | ||
| "aliases": True, |
There was a problem hiding this comment.
Discovery failure deletes aliases
When MSSQL synonym discovery fails temporarily, ingestion continues with an empty synonym map and produces aliases=None. Allowing this field through the patch turns that state into removal of /aliases, so a temporary source or permission failure silently deletes previously stored synonym metadata instead of preserving the last successful result.
Aliases are recomputed from the source on every run, but every table that already exists in OpenMetadata is updated through a PatchRequest, and build_patch diffs both models through `include=allowed_fields`. With `aliases` missing from the allow-list the field could never produce an operation, so SQL Server synonyms only ever landed on tables created for the first time - silently, with no error and a 100% success run. (cherry picked from commit 7759601)
733f787 to
2f808b9
Compare
Code Review ✅ Approved 1 closed / 1 findingsAdds ✅ 1 closed✅ Quality: New test class uses unittest.TestCase instead of pytest style
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 |
…stion 1.13.6.1 (#33400) * Fixes 33374: allow Table.aliases through the entity patch (#33377) Aliases are recomputed from the source on every run, but every table that already exists in OpenMetadata is updated through a PatchRequest, and build_patch diffs both models through `include=allowed_fields`. With `aliases` missing from the allow-list the field could never produce an operation, so SQL Server synonyms only ever landed on tables created for the first time - silently, with no error and a 100% success run. (cherry picked from commit 7759601) (cherry picked from commit c549c20) * bump ingestion 1.13.6.1
Describe your changes:
Fixes #33374
Backport of #33375 to the 1.13 release train.
Table.aliaseswas silently dropped on every table that already exists in OpenMetadata, so SQL Server synonyms (includeSynonyms, shipped on 1.13.6 via #33048) only ever landed on tables created for the very first time.When an entity already exists,
TopologyRunnerMixin.yield_and_update_contextemits aPatchRequestrather than a create, andsink/metadata_rest.py::patch_entitybuilds that patch withallowed_fields=ALLOWED_COMMON_PATCH_FIELDS.build_patchdiffs both models throughmodel_dump_json(include=allowed_fields), so a field missing from that dict can never produce an operation.aliaseswas missing: the connector discovered the synonyms, put them on the create request, and the patch threw them away — with no error and a 100% success run.Deliberately not added to
RESTRICT_UPDATE_LIST: aliases are source-managed and have to be replaceable and removable when a synonym is dropped at the source.Type of change:
Differences from the main PR
The production change is identical. The new
TestBuildPatchTableAliasesis pytest-style on both branches (plain class, bareassert), and differs only in placement: the 1.13 file ends in module-level pytest functions, so the class goes after them. Formatted with 1.13's toolchain —pycln,isortandblack==22.3.0all report no changes.Tests
BuildPatchTableAliasesTestdrivesbuild_patchthrough the exact argument set the sink uses (ALLOWED_COMMON_PATCH_FIELDS+RESTRICT_UPDATE_LIST+ARRAY_ENTITY_FIELDS) and covers first alias added, further alias appended, alias removed, and unchanged aliases. Four of the five fail without the one-line change:Verified end-to-end against a 1.13.6 server with the released
openmetadata-ingestion==1.13.6.0agent and a real SQL Server 2022 with synonyms, holdingoverrideMetadataconstant so the allow-list is the only variable:dbo.prod_catalog_legacyaliases.keywordsearchNotes for the release
sourceHashis in the allow-list, so a run on the broken build still advances the stored hash and the connector subsequently reports "no changes detected" and skips the table. Upgrading the agent alone therefore does not backfill existing tables — one run with Override Metadata enabled is needed after this ships.Checklist:
Fixes <issue-number>: <short description>.Greptile Summary
This PR allows source-managed table aliases, including SQL Server synonyms, to pass through the existing-entity patch path.
aliasesto the common patch-field allow-list so aliases can be added, replaced, and removed.aliases=Noneand remove previously stored aliases.Confidence Score: 4/5
The PR does not yet appear safe to merge because a temporary MSSQL synonym-discovery failure can remove previously stored aliases.
The previous blocking finding remains outstanding: allowing
aliases=Nonethrough the patch path emits removal of/aliases, so transient synonym-discovery or permission failures can erase the last successfully stored alias metadata. The earlier pytest-style finding was manually resolved and the current tests now use a plain class with bare assertions.Files Needing Attention: ingestion/src/metadata/ingestion/models/patch_request.py
Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch '1.13' into backport/table-..." | Re-trigger Greptile