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

[ADAP-1069] Custom batch_id prevents rebuilding the model on subsequent builds #1051

Closed
2 tasks done
dlubawy opened this issue Dec 8, 2023 · 6 comments · Fixed by #1076
Closed
2 tasks done

[ADAP-1069] Custom batch_id prevents rebuilding the model on subsequent builds #1051

dlubawy opened this issue Dec 8, 2023 · 6 comments · Fixed by #1076
Labels
help_wanted Extra attention is needed type:enhancement New feature or request

Comments

@dlubawy
Copy link

dlubawy commented Dec 8, 2023

Is this a new bug in dbt-bigquery?

  • I believe this is a new bug in dbt-bigquery
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Setting a custom batch_id in a Python model's build config prevents rebuilds. Cause is a failure to create new batches due to conflicting IDs.

Expected Behavior

Setting a custom batch_id still allows for future dbt building of Python models.

Steps To Reproduce

  1. Install v1.7 of dbt-core and dbt-bgiquery
  2. Create a Python model with a custom batch_id configuration: dbt.config(..., batch_id='foo')
  3. Build the Python model
  4. Try building the Python model again

Relevant log output

409 Already exists: Failed to create batch: Batch projects/xxx-xxx-xxx/locations/xx-xxxxx/batches/foo

Environment

- OS: Darwin (macOS) 21.6.0
- Python: 3.9.18
- dbt-core: 1.7.3
- dbt-bigquery: 1.7.2

Additional Context

No response

@dlubawy dlubawy added type:bug Something isn't working triage:product labels Dec 8, 2023
@github-actions github-actions bot changed the title [Bug] Custom batch_id prevents rebuilding the model on subsequent builds [ADAP-1069] [Bug] Custom batch_id prevents rebuilding the model on subsequent builds Dec 8, 2023
@dlubawy
Copy link
Author

dlubawy commented Dec 8, 2023

This was found after trying to bypass the ADAP-1067 issue by setting a custom batch_id.

@dlubawy
Copy link
Author

dlubawy commented Dec 11, 2023

Looks like I missed that this was also found in ADAP-1016.

@colin-rogers-dbt
Copy link
Contributor

Thanks for raising this @dlubawy, it's worth noting that the fix we have pushed out likely does not address this specific case as setting a static batch_id will be expected to fail on rerun (that's how dataproc batch Id's are supposed to work). Ultimately where we should go is probably having the config allow you to specify a batch_id prefix and we add the invocation_id as a suffix so that each run has a distinct batch_id.

@dlubawy
Copy link
Author

dlubawy commented Dec 18, 2023

Thanks for raising this @dlubawy, it's worth noting that the fix we have pushed out likely does not address this specific case as setting a static batch_id will be expected to fail on rerun (that's how dataproc batch Id's are supposed to work). Ultimately where we should go is probably having the config allow you to specify a batch_id prefix and we add the invocation_id as a suffix so that each run has a distinct batch_id.

Prefix with an appended invocation_id sounds like a good idea. However, there would need to be some enforcement on the user input for the configuration such that this wouldn't break due to batch_id length constraints. This is the issue for #1050 when batch_id was being derived from node names in v1.7.

@nathaniel-may nathaniel-may added Refinement and removed type:bug Something isn't working type:regression labels Dec 20, 2023
@nathaniel-may
Copy link
Contributor

This issue implies we have some opportunities to improve the UX around batch id.

@tanghyd
Copy link

tanghyd commented Jan 12, 2024

I've been running into this problem for a while now. For completeness on issue tracking, I'll link my recent comment on a related issue: #1006.

@nathaniel-may nathaniel-may changed the title [ADAP-1069] [Bug] Custom batch_id prevents rebuilding the model on subsequent builds [ADAP-1069] Custom batch_id prevents rebuilding the model on subsequent builds Feb 7, 2024
@nathaniel-may nathaniel-may added type:enhancement New feature or request help_wanted Extra attention is needed and removed refinement labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help_wanted Extra attention is needed type:enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants