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

Fix setting of global behavior flags #348

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Nov 12, 2024

resolves #351

Problem

As part of #323, we had introduced the require_batched_execution_for_custom_microbatch_strategy behaviour flag as part of the BaseAdapter._behavior_flags method. However, any concrete adapters that overwrote this property effectively removed the new behaviour flag from the collection, which would lead to downstream CompilationErrors (behaviour flag not registered).

Solution

Set up require_batched_execution_for_custom_microbatch_strategy as a global behaviour flag.

Also added a test to ensure BaseAdapter._behaviour_flags is always empty to avoid this issue in the future.

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

@MichelleArk MichelleArk requested a review from a team as a code owner November 12, 2024 21:30
@cla-bot cla-bot bot added the cla:yes label Nov 12, 2024
@MichelleArk
Copy link
Contributor Author

MichelleArk commented Nov 12, 2024

✅ Testing against dbt-snowflake: https://github.com/dbt-labs/dbt-snowflake/actions/runs/11806247075

This is the only first-party adapter that overrides BaseAdapter._behaviour_flags and would have encountered this issue.

@MichelleArk
Copy link
Contributor Author

MichelleArk commented Nov 12, 2024

✅ dbt-postgres testing: https://github.com/dbt-labs/dbt-postgres/actions/runs/11806285678

Mostly a sanity test for broader functional coverage.

dbt/adapters/base/impl.py Outdated Show resolved Hide resolved
dbt/adapters/base/impl.py Outdated Show resolved Hide resolved
@MichelleArk MichelleArk merged commit 85122e5 into main Nov 13, 2024
14 checks passed
@MichelleArk MichelleArk deleted the inc-1627-fix-global-behavior-flag-setting branch November 13, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Global behavior flags are getting overwritten
3 participants