diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index 6566a8400f4..5b5c6c90b8e 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -1765,8 +1765,9 @@ def _microbatch_macro_is_root(self, project_name: str, adapter_type: str) -> boo return microbatch_is_root def use_microbatch_batches(self, project_name: str, adapter_type: str) -> bool: - return get_flags().require_builtin_microbatch_strategy or self._microbatch_macro_is_root( - project_name=project_name, adapter_type=adapter_type + return ( + get_flags().require_batched_execution_for_custom_microbatch_strategy + or self._microbatch_macro_is_root(project_name=project_name, adapter_type=adapter_type) ) diff --git a/core/dbt/contracts/project.py b/core/dbt/contracts/project.py index b4570d4f88f..a02e93edd6b 100644 --- a/core/dbt/contracts/project.py +++ b/core/dbt/contracts/project.py @@ -338,7 +338,7 @@ class ProjectFlags(ExtensibleDbtClassMixin): write_json: Optional[bool] = None # legacy behaviors - https://github.com/dbt-labs/dbt-core/blob/main/docs/guides/behavior-change-flags.md - require_builtin_microbatch_strategy: bool = False + require_batched_execution_for_custom_microbatch_strategy: bool = False require_explicit_package_overrides_for_builtin_materializations: bool = True require_resource_names_without_spaces: bool = False source_freshness_run_project_hooks: bool = False @@ -350,7 +350,7 @@ class ProjectFlags(ExtensibleDbtClassMixin): @property def project_only_flags(self) -> Dict[str, Any]: return { - "require_builtin_microbatch_strategy": self.require_builtin_microbatch_strategy, + "require_batched_execution_for_custom_microbatch_strategy": self.require_batched_execution_for_custom_microbatch_strategy, "require_explicit_package_overrides_for_builtin_materializations": self.require_explicit_package_overrides_for_builtin_materializations, "require_resource_names_without_spaces": self.require_resource_names_without_spaces, "source_freshness_run_project_hooks": self.source_freshness_run_project_hooks, diff --git a/tests/functional/microbatch/test_microbatch.py b/tests/functional/microbatch/test_microbatch.py index 2a71b2a1238..0775745c859 100644 --- a/tests/functional/microbatch/test_microbatch.py +++ b/tests/functional/microbatch/test_microbatch.py @@ -155,7 +155,7 @@ def macros(self): def project_config_update(self): return { "flags": { - "require_builtin_microbatch_strategy": True, + "require_batched_execution_for_custom_microbatch_strategy": True, } } @@ -165,7 +165,7 @@ class TestMicrobatchCustomUserStrategyDefault(BaseMicrobatchCustomUserStrategy): def project_config_update(self): return { "flags": { - "require_builtin_microbatch_strategy": False, + "require_batched_execution_for_custom_microbatch_strategy": False, } } @@ -224,7 +224,7 @@ def models(self): def project_config_update(self): return { "flags": { - "require_builtin_microbatch_strategy": True, + "require_batched_execution_for_custom_microbatch_strategy": True, } } diff --git a/tests/functional/microbatch/test_microbatch_config_validation.py b/tests/functional/microbatch/test_microbatch_config_validation.py index f97e85a8f8a..d640ec84a93 100644 --- a/tests/functional/microbatch/test_microbatch_config_validation.py +++ b/tests/functional/microbatch/test_microbatch_config_validation.py @@ -87,7 +87,7 @@ def models(self): def project_config_update(self): return { "flags": { - "require_builtin_microbatch_strategy": True, + "require_batched_execution_for_custom_microbatch_strategy": True, } } @@ -105,7 +105,7 @@ def models(self): def project_config_update(self): return { "flags": { - "require_builtin_microbatch_strategy": True, + "require_batched_execution_for_custom_microbatch_strategy": True, } } diff --git a/tests/unit/context/test_providers.py b/tests/unit/context/test_providers.py index 10f5e108028..835cac345ce 100644 --- a/tests/unit/context/test_providers.py +++ b/tests/unit/context/test_providers.py @@ -58,7 +58,10 @@ def test_resolve_event_time_filter( expect_filter: bool, ) -> None: set_from_args( - Namespace(require_builtin_microbatch_strategy=dbt_experimental_microbatch), None + Namespace( + require_batched_execution_for_custom_microbatch_strategy=dbt_experimental_microbatch + ), + None, ) # Target mocking @@ -119,7 +122,9 @@ def test_create_relation_with_empty(self, resolver, empty, is_ephemeral_model, e mock_node.is_ephemeral_model = is_ephemeral_model mock_node.defer_relation = None - set_from_args(Namespace(require_builtin_microbatch_strategy=False), None) + set_from_args( + Namespace(require_batched_execution_for_custom_microbatch_strategy=False), None + ) # create limited relation with mock.patch("dbt.contracts.graph.nodes.ParsedNode", new=mock.Mock): @@ -160,7 +165,9 @@ def test_create_relation_with_empty(self, resolver, empty, expected_limit): mock_source.quoting_dict = {} resolver.manifest.resolve_source.return_value = mock_source - set_from_args(Namespace(require_builtin_microbatch_strategy=False), None) + set_from_args( + Namespace(require_batched_execution_for_custom_microbatch_strategy=False), None + ) # create limited relation relation = resolver.resolve("test", "test")