fix: apply column_tags when updating a view via ALTER#1526
Open
sd-db wants to merge 3 commits into
Open
Conversation
A V2 view with view_update_via_alter: true errored with "main is not
being called during running model" on a run whose only change was its
column tags: databricks__alter_view had no column_tags branch, so the
alter macro became a no-op that never called statement('main'). Add the
branch so the changed column tags are applied on the alter path, matching
the view create path and the table/incremental paths.
Closes #1525
99d88c1 to
cb9c5ec
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Collaborator
Author
|
/integration-test |
|
Integration tests dispatched for PR #1526 by @sd-db. Track progress in the Actions tab. |
jprakash-db
approved these changes
Jun 17, 2026
|
Integration results for PR #1526 — UC cluster ❌ failure · SQL warehouse ❌ failure · All-purpose cluster ✅ success · Shard coverage ✅ success |
Collaborator
Author
|
/integration-test |
|
Integration tests dispatched for PR #1526 by @sd-db. Track progress in the Actions tab. |
|
Integration results for PR #1526 — UC cluster ✅ success · SQL warehouse ✅ success · All-purpose cluster ✅ success · Shard coverage ✅ success |
ViewAPI._describe_relation now loads server column tags so view_update_via_alter runs no-op once tags match, with unit and functional test coverage.
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
Fixes #1525.
A Unity Catalog view configured with
view_update_via_alter: trueand column-leveldatabricks_tagsfailed on a subsequentdbt runwhose only change was its column tags, erroring withRuntime Error … main is not being called during running model.databricks__alter_viewhandledtags/tblproperties/query/column_commentsfrom the configuration changeset but had nocolumn_tagsbranch — whileViewConfig.config_componentsincludesColumnTagsProcessorand a column-tags-only change does not setrequires_full_refresh, so it routes toalter_viewrather than a full replace. With column tags as the only change, the macro became a no-op that never calledstatement('main').This adds the
column_tagsbranch todatabricks__alter_view(mirroring thetable/incremental paths), so the changed tags are applied on the alter path, matching the view create path.Testing
TestColumnTagsViewUpdateViaAlter(functional): a V2 view withview_update_via_alter: truewhose only second-run change is its column tags now applies them, asserted viasystem.information_schema.column_tags. Errored before the fix, passes after.test_macros__alter_view_with_column_tags(unit):alter_viewcallsapply_column_tagswhen the changeset carries acolumn_tagsentry, and not otherwise.