Skip to content

Add group column to models - #484

Merged
mtcarlone merged 8 commits into
brooklyn-data:mainfrom
vaibhav-chopda-wpe:add-group-column-to-models
Nov 6, 2026
Merged

mtcarlone merged 8 commits into
brooklyn-data:mainfrom
vaibhav-chopda-wpe:add-group-column-to-models

Conversation

@vaibhav-chopda-wpe

Copy link
Copy Markdown
Contributor

Overview

Add dbt group information to models (source) defined at project level.

Update type - breaking / non-breaking

  • Minor bug fix
  • Documentation improvements
  • Quality of Life improvements
  • New features (non-breaking change)
  • New features (breaking change)
  • Other (non-breaking change)
  • Other (breaking change)
  • Release preparation

What does this solve?

Currently, in the dbt_artifact we don't have a way to identify which node belongs to which group. This PR brings in group information from manifest and add it to the source model yaml.

Outstanding questions

What databases have you tested with?

  • Snowflake
  • Google BigQuery
  • Databricks
  • Spark
  • N/A

@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@vaibhav-chopda-wpe
vaibhav-chopda-wpe had a problem deploying to Approve Integration Tests March 4, 2025 15:03 — with GitHub Actions Failure
@mtcarlone mtcarlone self-assigned this Dec 15, 2025
@mtcarlone mtcarlone added this to the Jan 2026 Release milestone Jan 28, 2026

@mtcarlone mtcarlone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI failed due to a column mismatch on INSERT. Please resolve.

1f8100e (a persist_docs change for SQL Server) also removed
+on_schema_change: append_new_columns from the source tables, which
looks unintentional. Since then, re-running the package after an
upgrade can't add new columns to an existing consumer's tables, and
full_refresh: false rules out a rebuild. No column has been added since,
so nobody has hit it yet; the first release that adds one would break
every existing consumer's on-run-end hook. The README still documents
this config as set by the package.

Verified on DuckDB by building with main, then upgrading to a branch
that adds a column: without this line `dbt run --select dbt_artifacts`
fails and the hook errors with "Referenced column ... not found"; with
it the column is appended and uploads succeed.
The column was added between tags and meta, and only some overrides were
updated:
- Snowflake (default__): the values gained a 16th entry but the select
  list still read 15 positional columns, shifting meta and alias into
  the wrong columns.
- SQL Server: its column lists stopped at "15".
- Trino: its override had no group value at all.
- Every adapter stored tojson(group), i.e. '"finance"' with JSON quotes,
  or the string 'null' for models without a group.

owner_group is now the last column in the source model, the column-name
list and every override (positional column 16 on Snowflake and SQL
Server), as the column-order rule requires. The value is the plain group
name, or a real null when the model has no group (typed as varchar on
Trino, which can't infer a type from an all-null column).
Append owner_group to stg_dbt__models and dim_dbt__models
(dim_dbt__current_models selects every staging column), and document it
in the source, staging and mart YAML with a shared doc block.
The integration project now defines a dbt group and puts the
`incremental` model in it. A new singular test compares, for the
previous `dbt build`, each uploaded model's owner_group with its group
in the project graph (null when it has none).

Verified on DuckDB: passes on the two-pass build, fails when one model's
owner_group is changed.
@mtcarlone
mtcarlone self-requested a review November 6, 2026 21:10
@mtcarlone
mtcarlone merged commit 18b4ba7 into brooklyn-data:main Nov 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants