From 89ca7533862ebf114496a7f51e32fe5f00c78aef Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Tue, 5 Nov 2024 15:00:33 -0600 Subject: [PATCH] Add docstring to get_incremental_strategy_macro --- dbt/adapters/base/impl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dbt/adapters/base/impl.py b/dbt/adapters/base/impl.py index 8d17889e..06c6907c 100644 --- a/dbt/adapters/base/impl.py +++ b/dbt/adapters/base/impl.py @@ -1586,6 +1586,17 @@ def builtin_incremental_strategies(self): @available.parse_none def get_incremental_strategy_macro(self, model_context, strategy: str): + """Gets the macro for the given incremental strategy. + + Additionally some validations are done: + 1. Assert that if the given strategy is a "builtin" strategy, then it must + also be defined as a "valid" strategy for the associated adapter + 2. Assert that the incremental strategy exists in the model context + + Notably, something be defined by the adapter as "valid" without it being + a "builtin", and nothing will break (and that is desirable). + """ + # Construct macro_name from strategy name if strategy is None: strategy = "default"