validation: auto-promote source.targetNaming: withSchema to top-level targetNaming#2824
Draft
jshearer wants to merge 1 commit intojshearer/target_namingfrom
Draft
validation: auto-promote source.targetNaming: withSchema to top-level targetNaming#2824jshearer wants to merge 1 commit intojshearer/target_namingfrom
source.targetNaming: withSchema to top-level targetNaming#2824jshearer wants to merge 1 commit intojshearer/target_namingfrom
Conversation
…el `targetNaming`
During validation, materializations with `source.targetNaming` set to `withSchema` (or the legacy alias `fromSourceName`) and no top-level `targetNaming` now get promoted to `targetNaming: { strategy: matchSourceStructure }` as a model fix. These two settings produce identical resource paths, so the promotion is behavior-preserving.
This enables progressive migration away from the legacy `source.targetNaming` field. The old field remains functional via the fallback in `update_materialization_resource_spec`, so specs that haven't been re-published yet continue to work. Once the UI is updated to write the new top-level field directly, the legacy path can be removed.
* Add promotion logic in `walk_materialization` that fires only when `target_naming` is `None`
* Add `test_target_naming_promotion` verifying the fix fires and sets `MatchSourceStructure`
* Add `test_target_naming_no_promotion_when_set` verifying an explicit top-level value is not overwritten
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
During validation, materializations with
source.targetNamingset towithSchema(or the legacy aliasfromSourceName) and no top-leveltargetNamingnow get promoted totargetNaming: { strategy: matchSourceStructure }as a model fix. These two settings produce identical resource paths, so the promotion is behavior-preserving.This enables progressive migration away from the legacy
source.targetNamingfield. The old field remains functional via the fallback inupdate_materialization_resource_spec, so specs that haven't been re-published yet continue to work. Once the UI is updated to write the new top-level field directly, the legacy path can be removed.walk_materializationthat fires only whentarget_namingisNonetest_target_naming_promotionverifying the fix fires and setsMatchSourceStructuretest_target_naming_no_promotion_when_setverifying an explicit top-level value is not overwritten