Add utility macros for column-level comments from schema.yml - #10
Open
RyutoYoda wants to merge 3 commits into
Open
Add utility macros for column-level comments from schema.yml#10RyutoYoda wants to merge 3 commits into
RyutoYoda wants to merge 3 commits into
Conversation
Implements relation-level persist_docs functionality that automatically adds model descriptions from schema.yml as COMMENT clauses to Semantic View DDL. Key features: - Supports persist_docs.relation configuration - Detects and avoids conflicts with existing inline COMMENT syntax - Follows existing copy_grants pattern for consistency - Includes comprehensive test coverage for both enabled and disabled scenarios Resolves the TODO in semantic_view materialization and addresses the "persist_docs not supported" limitation documented in README.
Introduces get_column_comment() and get_model_comment() macros that automatically extract descriptions from schema.yml and apply them as COMMENT clauses in semantic views. This provides an optional way to add column-level documentation to semantic view elements (dimensions, facts, metrics) without manual comment writing.
Escape single quotes in column and model descriptions to prevent SQL syntax errors when descriptions contain apostrophes (e.g., "Customer's age").
|
Hey @sfc-gh-yutliu could we push this? 🙏🏻 |
|
Hello, yes that would come in really handy for us! |
|
☝️ |
|
+1 |
1 similar comment
|
+1 |
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.
Summary
get_column_comment()andget_model_comment()utility macrosTest plan
/macros/utils/get_column_comment.sqlBenefits