Skip to content

fix: warn on missing persist_docs columns for view/materialized_view/streaming_table create - #1615

Open
r-jais wants to merge 3 commits into
databricks:1.13.latestfrom
r-jais:fix/persist-docs-warn-missing-create-paths
Open

fix: warn on missing persist_docs columns for view/materialized_view/streaming_table create#1615
r-jais wants to merge 3 commits into
databricks:1.13.latestfrom
r-jais:fix/persist-docs-warn-missing-create-paths

Conversation

@r-jais

@r-jais r-jais commented Jul 28, 2026

Copy link
Copy Markdown

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 shared validate_doc_columns behavior 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:

  • view create (V1 + V2) — dbt/include/databricks/macros/materializations/view.sql
  • materialized view create/replace/refresh — .../materialized_view.sql
  • streaming table create/replace/refresh — .../streaming_table.sql

Each is a single validate_persist_doc_columns(target_relation, model) call after the relation is built. The macro is gated on config.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 in parse_columns_and_constraints). Previously these paths iterated only the query's output columns (get_persist_docs_column_list) or built inline comments via parse_columns_and_constraints, so a YAML-only documented column was silently dropped.

Stacking

This PR is stacked on #1563 and currently shows its commits too. It targets main; once #1563 merges, this diff reduces to just the view/materialized-view/streaming-table changes. Review/merge #1563 first.

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 on persist_docs.columns). New fixtures in tests/functional/adapter/persist_docs/fixtures.py. The core validate_persist_doc_columns logic is unit-tested in #1563.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

@sd-db

sd-db commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Can we rebase on the latest code for #1563 ?

@sd-db sd-db added the pending on pr-author Indicates waiting on the pr author to resolve a question/comment label Aug 7, 2026
@sd-db sd-db self-assigned this Aug 7, 2026
@r-jais
r-jais changed the base branch from main to 1.13.latest August 12, 2026 06:14
@r-jais
r-jais force-pushed the fix/persist-docs-warn-missing-create-paths branch from f1b69e6 to f591347 Compare August 12, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending on pr-author Indicates waiting on the pr author to resolve a question/comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Materialization v2 with update_via_alter for nonexistent columns

2 participants