dbt-labs / dbt-adapters

Apache License 2.0
28 stars 38 forks source link

Fix microbatch behavior flag check #350

Closed QMalcolm closed 1 week ago

QMalcolm commented 1 week ago

resolves #349

Problem

Previously we were adding microbatch to the list of builtin_incremental_strategies only when the behavior flag require_batched_execution_for_custom_microbatch_strategy was set to True. However in reality, we only want to set it True when that flag evaluates to False. This is because having the flag set to True implies by the transitive property that the project has a custom microbatch macro defined. In this situation, we don't want microbatch to be in the list of builtins because if the adapter doesn't have a builtin microbatch macro, things will break. Said another way, the only time that having microbatch in the list of builtin incremental strategies is relevant is when the flag is False.

Solution

Only add microbatch to the list of builtin_incremental_strategies when the behavior flag require_batched_execution_for_custom_microbatch_strategy is False

Checklist