fix: prevent spurious MicrobatchConcurrency warning on every run (#1406)#1409
Open
fix: prevent spurious MicrobatchConcurrency warning on every run (#1406)#1409
Conversation
dbt-core probes adapter.supports(MicrobatchConcurrency) during every manifest parse — Manifest.use_microbatch_batches returns True whenever the microbatch macro is built-in (always on dbt-core 1.9+), independent of whether any project model uses microbatch. Reading the behavior flag via bool() fires the one-shot BehaviorChangeEvent on that probe, surfacing a [WARNING] on every run even for projects without microbatch models, which breaks builds using --warn-error. Read via .no_warn so the probe does not fire the event. Update the companion test to set .setting = True instead of shadowing the flag object, and add a regression test guarding against the re-introduction. Co-authored-by: Isaac
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Co-authored-by: Isaac
tejassp-db
approved these changes
Apr 24, 2026
Collaborator
tejassp-db
left a comment
There was a problem hiding this comment.
It would be nice if there is a abstraction to track behavior flags, and the silenced ones are always called with .no_warn.
| if capability == Capability.MicrobatchConcurrency: | ||
| return bool(self.behavior.use_concurrent_microbatch) | ||
| # `.no_warn` avoids a BehaviorChangeEvent on dbt-core's per-parse probe. | ||
| return self.behavior.use_concurrent_microbatch.no_warn |
Collaborator
There was a problem hiding this comment.
Is there any way around using use_concurrent_microbatch such that it is more tightly tied with the declared behavior flags. Right now it is a property name which has to match what was defined earlier in USE_CONCURRENT_MICROBATCH.name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1406.
supports(Capability.MicrobatchConcurrency)read theuse_concurrent_microbatchbehavior flag viabool(...), which goes through the warning-firingBehaviorFlagRendered.settingpath. dbt-core probes this capability on every parse (viacheck_forcing_batch_concurrency), so the one-shotBehaviorChangeEventfired on every run regardless of whether the project contained microbatch models — breaking--warn-errorbuilds.Read via
.no_warninstead — same gating, no event.Test plan
hatch run unit→ 742 passed, 0 regressionstest_microbatch_concurrency_probe_does_not_warn