From 69278ac2e72fcaebec7469821f9f8d613ea817b6 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Tue, 12 Nov 2024 15:03:04 -0600 Subject: [PATCH] Fix setting of global behavior flags --- .changes/unreleased/Fixes-20241112-143740.yaml | 6 ++++++ dbt/adapters/base/impl.py | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20241112-143740.yaml diff --git a/.changes/unreleased/Fixes-20241112-143740.yaml b/.changes/unreleased/Fixes-20241112-143740.yaml new file mode 100644 index 00000000..567a1e9b --- /dev/null +++ b/.changes/unreleased/Fixes-20241112-143740.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Move require_batched_execution_for_custom_microbatch_strategy flag to gloabl +time: 2024-11-12T14:37:40.681284-06:00 +custom: + Author: QMalcolm + Issue: N/A diff --git a/dbt/adapters/base/impl.py b/dbt/adapters/base/impl.py index 752389c1..6da55b13 100644 --- a/dbt/adapters/base/impl.py +++ b/dbt/adapters/base/impl.py @@ -262,6 +262,13 @@ class BaseAdapter(metaclass=AdapterMeta): } MAX_SCHEMA_METADATA_RELATIONS = 100 + GLOBAL_BEHAVIOR_FLAGS = [ + { + "name": "require_batched_execution_for_custom_microbatch_strategy", + "default": False, + "docs_url": "https://docs.getdbt.com/docs/build/incremental-microbatch", + } + ] # This static member variable can be overridden in concrete adapter # implementations to indicate adapter support for optional capabilities. @@ -274,7 +281,7 @@ def __init__(self, config, mp_context: SpawnContext) -> None: self._macro_resolver: Optional[MacroResolverProtocol] = None self._macro_context_generator: Optional[MacroContextGeneratorCallable] = None # this will be updated to include global behavior flags once they exist - self.behavior = [] # type: ignore + self.behavior = self.GLOBAL_BEHAVIOR_FLAGS # type: ignore ### # Methods to set / access a macro resolver