-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for adding BigQuery policy tags #2586
Comments
Thanks for the detailed writeup, @azhard! Since dbt adds labels and descriptions to tables and views when initially creating them, it makes sense enough to me that dbt could add these policy tags as well. Is this a feature you'd be interested in contributing?
I'm inclined to require users to fully qualify tag names, unless you have a strong feeling for us systematizing these in a highly opinionated way. Related issues
|
Yeah more than happy to work on this @jtcohen6 ! With respect to the tag names, I think having the user fully qualify them makes sense as well so will incorporate that into the PR. What're your thoughts around the Also re: the related issues. Both make sense to me and would love to get this working with the future persist_source macro! |
@jtcohen6 ended up sticking the policy tags in the |
I'm supportive of that. Quick turnaround on the PR! I'll take a look a bit later today |
hmmm, I think we may not want to repurpose That might be a little bit tricky to implement today as I don't think we have any notion of database-specific What do y'all think? |
Yeah I think that makes sense actually, don't want to override any dbt specific functionality that leverages the |
do we specifically want this config to live in the
I totally get that it's not ideal to write out the column list twice, but this is definitely one option! If we really really want to, we could add this config as a dbt Core-level config that's only used on BigQuery. That's definitely not my preference.... but in looking at the config above, I do think |
Aside from defining the columns twice, my main concern with the first option is that I don't believe that method can be leveraged for I'm also hesitant on adding this as a core-level config, don't think it makes sense to expose it to other adapters. Not sure where that would leave implementation for this feature for now though |
Ah, ok, thanks for that context @azhard! I gave this some more thought, and I'm increasingly happy with the idea of adding a BQ specific config in the I'll take a look at #2589 and follow up over there with a review! |
Describe the feature
Policy tags are a BigQuery feature that allows users to set column level access control (docs). After a tag has been created, it can be added programatically via the BigQuery python library to columns as needed.
This proposed feature would allow users to add (already created) policy tags to their existing dbt models through their
schema.yml
files.Considerations:
google-cloud-bigquery
in version 1.25.0 (latest version). Dbt currently is using version 1.24.0 so this will need to be bumped upcolumns
is set to true for persist_docs.meta
field. Alternatively a new BigQuery specific schema field could be usedupdate_column_description
adapter function that is. called duringpersist_docs
. The advantage here is that we're already iterating over the columns so we wouldn't have to do it again and the function name can be changed to something more generic eg.update_column
From my understanding, this is something that currently can only be supported for models in the
schema.yml
files as I don't think docs can be updated for sources but that would be an ideal situation to support this as wellAdditional context
This feature would be specific to BigQuery.
Who will this benefit?
BigQuery users who currently use (or want to start using) policy tags and manage them through their dbt setup.
The text was updated successfully, but these errors were encountered: