Skip to content

feat(bigquery): support data governance tags on columns - #16694

Open
AxelThevenot wants to merge 1 commit into
dbt-labs:mainfrom
AxelThevenot:feat/bigquery-data-governance-tags
Open

AxelThevenot wants to merge 1 commit into
dbt-labs:mainfrom
AxelThevenot:feat/bigquery-data-governance-tags

Conversation

@AxelThevenot

Copy link
Copy Markdown

Resolves #16693

Problem

BigQuery supports data governance tags for column-level access control, and dbt column properties cannot declare or apply them.

Solution

Add a data_governance_tags column property with one namespaced key and one value short name. When persist_docs.columns is enabled, dbt emits one ALTER TABLE that sets the tag on each supported column.

columns:
  - name: email
    data_governance_tags:
      key: my-project/data_class
      value: email

Supported:

  • BigQuery tables
  • Top-level, non-STRUCT columns
  • One governance tag per column
  • Setting and replacing a tag
    • key: <project-or-organization>/<tag-key>
    • value: <tag-value-short-name>

Not supported:

  • Views and materialized views (BigQuery limitation)
  • STRUCT or RECORD parent columns (BigQuery limitation)
  • Nested STRUCT leaf fields
  • Several tags on one column (BigQuery limitation)

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.

Expose BigQuery data governance tags through column properties and apply
them during persisted column documentation. BigQuery DDL currently limits
this path to top-level table columns.

Refs dbt-labs#16693
@AxelThevenot
AxelThevenot requested a review from a team as a code owner October 11, 2026 10:07
@cla-bot cla-bot Bot added the cla:yes label Oct 11, 2026

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Failed
Enforce advisory code health rules (1 file with Large Method)

Our agent can fix these. Install it.

Gates Passed
3 Quality Gates Passed

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
utils.rs 1 advisory rule 5.01 → 5.01 Suppress

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

meta: existing.map(|col| col.meta.clone()).unwrap_or_default(),
tags: existing.map(|col| col.tags.clone()).unwrap_or_default(),
policy_tags: existing.and_then(|col| col.policy_tags.clone()),
data_governance_tags: existing.and_then(|col| col.data_governance_tags.clone()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Getting worse: Large Method
update_node_columns increases from 70 to 71 lines of code, threshold = 70

Suppress

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support BigQuery data governance tags in column properties

1 participant