fix: warn on missing persist_docs columns for view/materialized_view/streaming_table create - #1615
Open
r-jais wants to merge 3 commits into
Open
Conversation
r-jais
force-pushed
the
fix/persist-docs-warn-missing-create-paths
branch
from
August 6, 2026 09:06
31870e8 to
f1b69e6
Compare
Collaborator
|
Can we rebase on the latest code for #1563 ? |
r-jais
force-pushed
the
fix/persist-docs-warn-missing-create-paths
branch
from
August 12, 2026 06:57
f1b69e6 to
f591347
Compare
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
resolves #1399
Follow-up to #1563. That PR added the "warn when a documented column is absent from the relation" check as a post-build validation (
validate_persist_doc_columns, mirroring the sharedvalidate_doc_columnsbehavior every other adapter uses) and wired it into the table and incremental materializations.This PR completes the create-time coverage by calling the same gated, post-build validation on the materializations #1563 didn't touch:
dbt/include/databricks/macros/materializations/view.sql.../materialized_view.sql.../streaming_table.sqlEach is a single
validate_persist_doc_columns(target_relation, model)call after the relation is built. The macro is gated onconfig.persist_column_docs()and applies no comments, so it never fires when column persistence is off and stays safe under--warn-error(per the caution in #1563 about not warning unconditionally inparse_columns_and_constraints). Previously these paths iterated only the query's output columns (get_persist_docs_column_list) or built inline comments viaparse_columns_and_constraints, so a YAML-only documented column was silently dropped.Stacking
Tests
Functional (
tests/functional/adapter/persist_docs/test_persist_docs.py): create-time missing-column warning for view, materialized view, and streaming table (each: documented column absent from the relation → warns exactly once, gated onpersist_docs.columns). New fixtures intests/functional/adapter/persist_docs/fixtures.py. The corevalidate_persist_doc_columnslogic is unit-tested in #1563.Checklist
CHANGELOG.mdand added information about my change to the "dbt-databricks next" section.