Skip to content

Commit

Permalink
Add .no_warn to the evaluation of `require_batched_execution_for_cu…
Browse files Browse the repository at this point in the history
…stom_microbatch_strategy`

The situation in which we want to warn the user about the behavior flag is
exceedingly small. Specifically, we want to fire a deprecation warning when
1. The behavior flag is false
2. The user is executing a `microbatch` model
3. The user has a custome `microbatch` macro

In dbt-adapters we could check (1) and (2), but we have no ability to
check (3). Thus emitting the warning in dbt-adapters upon evaluation of
the behavior flag `require_batched_execution_for_custom_microbatch_strategy`
is _undesirable_. Instead we'll be emitting a deprecation warning from
dbt-core.
  • Loading branch information
QMalcolm committed Nov 8, 2024
1 parent 1059eef commit 2f436ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ def valid_incremental_strategies(self):

def builtin_incremental_strategies(self):
builtin_strategies = ["append", "delete+insert", "merge", "insert_overwrite"]
if self.behavior.require_batched_execution_for_custom_microbatch_strategy:
if self.behavior.require_batched_execution_for_custom_microbatch_strategy.no_warn:
builtin_strategies.append("microbatch")

return builtin_strategies
Expand Down

0 comments on commit 2f436ba

Please sign in to comment.