From ea17ecac53889d28154bd4ea12d52e41b0690385 Mon Sep 17 00:00:00 2001 From: GuyEshdat <81393741+GuyEshdat@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:54:59 +0300 Subject: [PATCH 1/4] fix: rename macro to capture_microbatch_compiled_code_sql to avoid breaking microbatch for all Elementary users --- .../microbatch/capture_microbatch_compiled_code.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql b/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql index 588c32cd5..3fb163802 100644 --- a/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql +++ b/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql @@ -4,7 +4,7 @@ incremental strategy resolution in all projects. To apply this behavior, users should: 1) Override `get_incremental_microbatch_sql` in their own project and delegate to - `elementary.get_incremental_microbatch_sql(arg_dict)`. + `elementary.capture_microbatch_compiled_code_sql(arg_dict)`. 2) Enable dbt behavior flag `require_batched_execution_for_custom_microbatch_strategy`. This flow is currently not supported for adapters: @@ -17,7 +17,7 @@ This flow is currently not supported for dbt Fusion. -#} -{% macro get_incremental_microbatch_sql(arg_dict) %} +{% macro capture_microbatch_compiled_code_sql(arg_dict) %} {% if execute and model is defined %} {% do elementary.capture_microbatch_compiled_code_for_model() %} {% endif %} @@ -46,3 +46,4 @@ {% endif %} {% do compiled_code_by_unique_id.update({model_unique_id: model_compiled_code}) %} {% endmacro %} + From 6ced287eb93b346285b8658bfa5d8ddc30d67ec2 Mon Sep 17 00:00:00 2001 From: GuyEshdat <81393741+GuyEshdat@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:55:30 +0300 Subject: [PATCH 2/4] fix: update test to call elementary.capture_microbatch_compiled_code_sql --- .../tests/test_dbt_artifacts/test_microbatch_compiled_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py b/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py index 98cabc80a..3de5781c1 100644 --- a/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py +++ b/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py @@ -100,7 +100,7 @@ def _with_microbatch_macro_file(dbt_project: DbtProject, macro_name: str): macro_path = dbt_project.project_dir_path / "macros" / "microbatch.sql" macro_sql = """ {% macro __MACRO_NAME__(arg_dict) %} - {{ return(elementary.get_incremental_microbatch_sql(arg_dict)) }} + {{ return(elementary.capture_microbatch_compiled_code_sql(arg_dict)) }} {% endmacro %} """.replace( "__MACRO_NAME__", macro_name From ae0f3b1ed2f77b6dc2a564daef74afa2f03a1ca0 Mon Sep 17 00:00:00 2001 From: GuyEshdat <81393741+GuyEshdat@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:00:47 +0300 Subject: [PATCH 3/4] fix: rename to capture_and_execute_microbatch_compiled_code_sql --- .../microbatch/capture_microbatch_compiled_code.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql b/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql index 3fb163802..47883612a 100644 --- a/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql +++ b/macros/edr/dbt_artifacts/microbatch/capture_microbatch_compiled_code.sql @@ -4,7 +4,7 @@ incremental strategy resolution in all projects. To apply this behavior, users should: 1) Override `get_incremental_microbatch_sql` in their own project and delegate to - `elementary.capture_microbatch_compiled_code_sql(arg_dict)`. + `elementary.capture_and_execute_microbatch_compiled_code_sql(arg_dict)`. 2) Enable dbt behavior flag `require_batched_execution_for_custom_microbatch_strategy`. This flow is currently not supported for adapters: @@ -17,7 +17,7 @@ This flow is currently not supported for dbt Fusion. -#} -{% macro capture_microbatch_compiled_code_sql(arg_dict) %} +{% macro capture_and_execute_microbatch_compiled_code_sql(arg_dict) %} {% if execute and model is defined %} {% do elementary.capture_microbatch_compiled_code_for_model() %} {% endif %} @@ -46,4 +46,3 @@ {% endif %} {% do compiled_code_by_unique_id.update({model_unique_id: model_compiled_code}) %} {% endmacro %} - From 8d7858d2fc7607d8b1a10f1c09bc2f7cfa3b2755 Mon Sep 17 00:00:00 2001 From: GuyEshdat <81393741+GuyEshdat@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:00:51 +0300 Subject: [PATCH 4/4] fix: update test to call capture_and_execute_microbatch_compiled_code_sql --- .../tests/test_dbt_artifacts/test_microbatch_compiled_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py b/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py index 3de5781c1..6c98d0389 100644 --- a/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py +++ b/integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py @@ -100,7 +100,7 @@ def _with_microbatch_macro_file(dbt_project: DbtProject, macro_name: str): macro_path = dbt_project.project_dir_path / "macros" / "microbatch.sql" macro_sql = """ {% macro __MACRO_NAME__(arg_dict) %} - {{ return(elementary.capture_microbatch_compiled_code_sql(arg_dict)) }} + {{ return(elementary.capture_and_execute_microbatch_compiled_code_sql(arg_dict)) }} {% endmacro %} """.replace( "__MACRO_NAME__", macro_name