dbt-labs / dbt-labs/dbt-adapters

[ADAP-1024] [Feature] Save tags to Snowflake using object tagging feature

Open
#730 4 comments 32 reactions 0 assignees View on GitHub
pkg:dbt-snowflake type:enhancement
Dominant language
Python
Stars
233
Forks
362
Avg merge
3d 22h
Merged PRs (30d)
9

Description

### Is this your first time submitting a feature request?

- [x] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [X] I have searched the existing issues, and I could not find an existing issue for this feature
- [X] I am requesting a straightforward extension of existing dbt-snowflake functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

Besides dbt tags there should be possibility to define 'snowflake-tags' for tables and columns (and possibly schemas), which would be persisted to Snowflake as tags (https://docs.snowflake.com/en/user-guide/object-tagging).

### Describe alternatives you've considered

We are aware of the dbt-snowflake-utils package by Montreal Analytics, which now has [a macro that creates Snowflake tags](https://github.com/Montreal-Analytics/dbt-snowflake-utils#snowflake_utilsapply_meta_as_tags-source) from model/column meta.

It is not usable for tag-based masking though, because there is a time gap between materializing a table and creating a tag (currently it creates tags in on-run-end, so when all models are ready), which would create a **serious vulnerability in PII protection**. Therefore tags need to be a part of the CTAS (same as masking policies problem described in dbt-labs/dbt-adapters#85

### Who will this benefit?

Tags are useful for monitoring, but also they enable a **[powerful feature called tag-based masking](https://docs.snowflake.com/en/user-guide/tag-based-masking-policies)**, which is getting more and more popular.

### Are you interested in contributing this feature?

_No response_

### Anything else?

This feature has already been requested (#104), but closed with suggestion, that the dbt-snowflake-utils macro is a sufficient alternative. It may be for some cases, but we take our PII protection too seriously to enable a time gap between table materialization and tag creation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.