Skip to content

add configurable write_mode to BigQueryIOManager#32998

Merged
smackesey merged 14 commits into
dagster-io:masterfrom
michalcabir-ui:feat/bigquery-write-modes
Mar 10, 2026
Merged

add configurable write_mode to BigQueryIOManager#32998
smackesey merged 14 commits into
dagster-io:masterfrom
michalcabir-ui:feat/bigquery-write-modes

Conversation

@michalcabir-ui

@michalcabir-ui michalcabir-ui commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

Summary & Motivation

Added a configurable write_mode option to BigQueryIOManager to support schema evolution and different writing strategies for non-partitioned tables.

Currently, the IO manager forces a TRUNCATE operation, which deletes rows but preserves the schema. This causes failures when the DataFrame schema changes (e.g., adding/removing columns).

How I Tested These Changes

Unit Testing: Created a new test file dagster_gcp_tests/bigquery_tests/test_bigquery_write_modes.py using unittest.mock.
Verified that write_mode="truncate" triggers a TRUNCATE TABLE query.
Verified that write_mode="replace" triggers a DROP TABLE IF EXISTS query.
Verified that write_mode="append" triggers no cleanup query.
Verified that partitioned tables ignore the write mode and use the legacy DELETE FROM logic.
Added a factory test to ensure the BigQueryClient is initialized with the correct default write_mode for backward compatibility.

Changelog

feat(gcp): Add write_mode configuration to BigQueryIOManager (supports truncate, replace, append) to allow schema evolution and append-only workflows.

Added support for truncate, replace, and append modes to allow schema evolution and append-only workflows. Includes unit tests and documentation updates.
@michalcabir-ui michalcabir-ui marked this pull request as ready for review December 7, 2025 19:53
@michalcabir-ui michalcabir-ui requested a review from a team as a code owner December 7, 2025 19:53
Comment thread python_modules/libraries/dagster-gcp/dagster_gcp/bigquery/io_manager.py Outdated
Comment thread python_modules/libraries/dagster-gcp/dagster_gcp/bigquery/io_manager.py Outdated
@smackesey

Copy link
Copy Markdown
Collaborator

@michalcabir-ui I unblocked our CI tests (and we're looking into getting them to launch automatically for you), but I can't tell if you're able to see the results-- are you able to click through into the failing buildkite/unit-tests?

@michalcabir-ui

Copy link
Copy Markdown
Contributor Author

@michalcabir-ui I unblocked our CI tests (and we're looking into getting them to launch automatically for you), but I can't tell if you're able to see the results-- are you able to click through into the failing buildkite/unit-tests?

I fixed the remarks but now i can`t run it again or see the logs for the new CI build

@smackesey

Copy link
Copy Markdown
Collaborator

@michalcabir-ui I unblocked and see some more CI issues-- FWIW we are working on a solution where a Dagster employee won't need to manually unblock each time for you.

@neverett neverett 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.

Left a few suggestions on the docs changes, will leave final review and approval to @smackesey

Comment thread docs/docs/integrations/libraries/gcp/bigquery/reference.md Outdated
Comment thread docs/docs/integrations/libraries/gcp/bigquery/using-bigquery-with-dagster.md Outdated
michalcabir-ui and others added 2 commits December 30, 2025 15:44
style fix

Co-authored-by: Nikki Everett <neverett@users.noreply.github.com>
…ith-dagster.md


style fix

Co-authored-by: Nikki Everett <neverett@users.noreply.github.com>
@smackesey

smackesey commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

@michalcabir-ui Still seeing a bunch of failing bigquery-related tests, pls have a look. Sorry for the slow iteration with the tests here, we are working on improving this process. In the meantime, I'll keep this top of queue continually unblocking till we land it.

@michalcabir-ui

Copy link
Copy Markdown
Contributor Author

@michalcabir-ui Still seeing a bunch of failing bigquery-related tests, pls have a look. Sorry for the slow iteration with the tests here, we are working on improving this process. In the meantime, I'll keep this top of queue continually unblocking till we land it.

Hi, I fixed the Pyright errors, pass credentials to Spark client, and fix prettier formatting.
That said, I see the build is still red, so I definitely need to take another look at what's going on.
I suspect it might be related to that Helm 404 error(that seems like an external issue unrelated to my changes should I update it?), but since I’m still blocked from the full logs, I can’t be 100% sure yet. Could you please unblock the logs? Thanks!

@smackesey smackesey merged commit 0bf603a into dagster-io:master Mar 10, 2026
3 of 4 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.

3 participants