fix: warn when documented columns are missing from the relation in persist_docs#1563
Open
r-jais wants to merge 1 commit into
Open
fix: warn when documented columns are missing from the relation in persist_docs#1563r-jais wants to merge 1 commit into
r-jais wants to merge 1 commit into
Conversation
…_docs When persist_docs.columns is enabled, columns documented in a model's schema.yml but absent from the materialized relation were silently skipped by get_persist_doc_columns. Emit a warning naming those columns so users can catch typos and stale documentation. The columns are still filtered out (no behavior change to the comments that get applied). Ports the behavior added upstream in dbt-adapters#1684 (issue #1690).
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Resolves #
Description
When
persist_docs.columnsis enabled,DatabricksAdapter.get_persist_doc_columnsonly iterates the columns that actually exist in the materialized relation. As a result, any column documented in a model'sschema.ymlthat is not present in the relation (typo, renamed column, stale docs) is silently skipped — no comment is applied and no feedback is given to the user.This PR adds a warning that names those columns. The filtering behavior is unchanged (the missing columns are still skipped so the
ALTERnever errors); we just surface them viawarn_or_error, so it respects--warn-errorlike other adapter warnings.This ports the behavior added upstream in dbt-adapters — dbt-labs/dbt-adapters#1684 (closes dbt-labs/dbt-adapters#1690). Because dbt-databricks overrides
persist_docswith its own nativeget_persist_doc_columns, the upstream macro change does not reach this adapter, so the warning is added here directly.Example warning:
Checklist
CHANGELOG.mdand added information about my change to the "dbt-databricks next" section.