Skip to content

Update for nested fields#98

Merged
evie-autotrader merged 63 commits into
mainfrom
update-for-nested-fields
May 12, 2026
Merged

Update for nested fields#98
evie-autotrader merged 63 commits into
mainfrom
update-for-nested-fields

Conversation

@shugewang

@shugewang shugewang commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Since dbt-bigquery 1.11 you can now add struct fields to an incremental when on_schema_change is set to append_new_columns or sync_new_columns

This PR updates the schema change handlers to support struct schema changes

Fixes #96

Checklist:

  • I have run make verify and fixed any linting or test errors
  • I have added appropriate unit tests or if applicable an integration test
  • OPTIONAL: I have run make integration against a Big Query instance

@shugewang shugewang marked this pull request as ready for review April 27, 2026 13:38
Comment thread dbt_dry_run/models/table.py Outdated
Comment thread dbt_dry_run/utils.py Outdated
@ccharlesgb

Copy link
Copy Markdown
Collaborator

We should probably have at least one integration test. You can use this one as a reference

You will need to create an incremental in projects/test_incremental. The with compiled_project.create_state(manifest_node, columns): will set the initial table schema up before running the integration test so you could create a model that has a struct with one field. Then the model adds another field and the predicted schema has both fields.

@shugewang shugewang marked this pull request as draft May 11, 2026 08:33
shugewang and others added 2 commits May 11, 2026 10:30
Remove references to new and existing tables
Rename _get_new_fields
Move MAX_SUPPORTED_NESTED_FIELD_DEPTH to Table
@shugewang shugewang marked this pull request as ready for review May 11, 2026 10:46

@ccharlesgb ccharlesgb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Almost there. Just one question on the classmethod and a bit of confusion about the path attribute

Comment thread dbt_dry_run/models/table.py Outdated
Comment thread dbt_dry_run/models/table.py Outdated
@evie-autotrader evie-autotrader merged commit 1637382 into main May 12, 2026
4 checks passed
@evie-autotrader evie-autotrader deleted the update-for-nested-fields branch May 12, 2026 12:01
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.

Incremental models now support struct schema changes

5 participants