Montreal-Analytics / dbt-snowflake-utils

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

Expose environment variables for database and schema names for tag setting #28

Open JFrackson opened 1 year ago

JFrackson commented 1 year ago

Description:

Expose two environment variables to allow package users to specify where tags should be created in Snowflake when leveraging the apply_meta_as_tags macro.

The current behaviour is to use the model's database and schema, which should work well for most but may not be ideal for all circumstances. This behaviour was implemented thanks to a contribution from @calleo in PR #25 .

If this issue is relevant to you, please leave a comment or thumbs up reaction to help us prioritize!

tongqqiu commented 1 year ago

Yes. we do like to have a centralized place for all tags. It would be much easier to associate centralized data masking policy with tags.

kanomaxb commented 1 year ago

Yes, please, let us use tags defined in other dbs/schemas. In particular we might want to use dedicated snowflake tags SNOWFLAKE.CORE.SEMANTIC_CATEGORY and/or SNOWFLAKE.CORE.PRIVACY_CATEGORY.

kanomaxb commented 1 year ago

Current behaviour is error prone. I'd like to allow our users to use tags from our predefined set only (we manage tags and other Snowflake objects with terraform). If they make a typo a new tag will be created and they will never now, and my monitoring will become useless. So I would like to be able to switch off the auto-creation.

jamesweakley commented 1 year ago

Current behaviour is error prone. I'd like to allow our users to use tags from our predefined set only (we manage tags and other Snowflake objects with terraform). If they make a typo a new tag will be created and they will never now, and my monitoring will become useless. So I would like to be able to switch off the auto-creation.

I've copied this one into a new issue

DavidfNZ commented 1 year ago

Yep we wrote our own macro for tags, for the same reason..we managed the tag list centrally and didn't want tags being auto-created. We also had a separate central Snowflake database just for data governance (including data masking policies and tags), so needed the tags to reference that from other databases.