Montreal-Analytics / dbt-snowflake-utils

Snowflake-specific utility macros for dbt projects.
Apache License 2.0
107 stars 37 forks source link

apply_meta_as_tags assumes the object being tagged is a table #32

Open DavidfNZ opened 1 year ago

DavidfNZ commented 1 year ago

We have a need to be able to apply column tags to either tables or views (particularly views in the serving layer).

jamesweakley commented 1 year ago

When fetching tag references (TAG_REFERENCES_ALL_COLUMNS function), Snowflake treats tables and views as the same. So it should be only the 'alter table' statements that need fixing. Probably easiest to toggle this based on the dbt model config (res.node.config.materialized == 'view') rather than doing information schema queries to determine which it is.

DavidfNZ commented 1 year ago

yes i've done a bit of investigation and that was my conclusion as well. so can pass that attribute thru to the routine that generates the ALTER atatement