Add macro to support introspection on semantic view - #13
Draft
sfc-gh-yutliu wants to merge 2 commits into
Draft
Conversation
sfc-gh-yutliu
force-pushed
the
yutliu-fix-issue-5
branch
from
November 6, 2025 00:21
9671615 to
531bd0b
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.
Root cause:
DBT adapter does not support semantic view, so
snowflake__get_columns_in_relationwill fail if taking a semantic view as argument.Solution:
Add customization macro of
snowflake__get_columns_in_relationin dbt_semantic_view package to return empty column list instead of go to defaultdescribe table <semantic_view>to avoidInvalid object type: 'TABLE'issue.Caveat:
customers need to add
search_order: [dbt_semantic_view, dbt](see dbt_project.yml change in this pr) to make the package override take precedent of dbt's implementation.Tests:
search_order: [dbt_semantic_view, dbt], running macro debug_call_get_columns will fail.Running model
dbt run --models union_table_refer_to_semantic_viewswill fail.search_order: [dbt_semantic_view, dbt], running macro debug_call_get_columns will succeed.Running model
dbt run --models union_table_refer_to_semantic_viewswill fail, but not the errorInvalid object type: 'TABLE'.