Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use "direct" write for non-partitioned python model materializations #1388

Merged
merged 11 commits into from
Oct 29, 2024

Conversation

colin-rogers-dbt
Copy link
Contributor

@colin-rogers-dbt colin-rogers-dbt commented Oct 29, 2024

resolves #1318

In order to support partitioned materializations in BQ python models we we switched from "direct" to "indirect" mode when writing model results in Dataproc back to BigQuery. As the naming implies "indirect" temporarily stages data in the provided GCS bucket. If a user has a retention policy on the bucket this will fail as the bucket won't allow Dataproc to delete these temp files as it goes.

This PR sidesteps that issue to ensure backwards compatibility with <1.7 created models by using "direct" write when a partitioned config is not provided.

Note: I have not added any new testing to cover the case where a user has set a retention policy. Ultimately I think this is an edge case we don't need to test against but we should document that a bucket retention policy cannot be used with a partitioned python model as a follow up

docs dbt-labs/docs.getdbt.com/#

Problem

Solution

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/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

@colin-rogers-dbt colin-rogers-dbt self-assigned this Oct 29, 2024
@colin-rogers-dbt colin-rogers-dbt requested a review from a team as a code owner October 29, 2024 00:32
@cla-bot cla-bot bot added the cla:yes label Oct 29, 2024
Copy link
Contributor

@VersusFacit VersusFacit left a comment

Choose a reason for hiding this comment

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

one nit

@colin-rogers-dbt colin-rogers-dbt merged commit a09a8fa into main Oct 29, 2024
42 checks passed
@colin-rogers-dbt colin-rogers-dbt deleted the supportDirectWritesAgain branch October 29, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants