policy_tag in BigQuery (dbt_core) getting wiped

Every time I set the policy_tags in BigQuery (BQ) and rerun my dbt transformations the policy gets wiped away. I have enabled the proper permissions in BQ ( Data Catalog Admin & Policy Tag Admin to be sure) and established the +persist_doc config suggested in dbt_project.yml. My schema.yml contains the policy_tag setup as explained in dbt docs.

Need to establish policy_tags in BQ to have a targeted permission-based access to PII fields in our datasets.

Detailed approach above. Any video or doc link of examples would be greatly appreciated. Not seeing much out there in my search.

model/schema.yml

Hi @jab, weird problem, can you show your persist_docs config?

dbt_project.yml

Yep, everything looks good, not sure what the problem is

I would try to set the persist_docs configuration inside the model to see if it is any problem with the dbt_project.yml

{{ config(
  persist_docs={"relation": true, "columns": true}
) }}

select ...

Just to be sure

1 Like

I’ll give it a shot. To be 100% clear, the persist_docs refers to the target schema (as in where the model will build into) and not the source schema (where the SQL is pulling from).

[Update] Be sure to assign policy in model/schema.yml to specific filed path. The main issue I discovered here had more to do with the COLUMN naming (name.fullName NOT fullName). Thanks @brunoszdl for ensuring the rest was correct.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.