From 86efa882075fbba7cc9ecd91d3ebdebca22e5026 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Wed, 4 Dec 2024 13:18:33 -0600 Subject: [PATCH 1/2] Append `model.batch.id` to suffix in `make_temp_relation` when present (#361) --- dbt/include/global_project/macros/adapters/relation.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbt/include/global_project/macros/adapters/relation.sql b/dbt/include/global_project/macros/adapters/relation.sql index b9af49692..ae1f041dd 100644 --- a/dbt/include/global_project/macros/adapters/relation.sql +++ b/dbt/include/global_project/macros/adapters/relation.sql @@ -7,6 +7,11 @@ {% endmacro %} {% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %} + {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#} + {% if suffix == '__dbt_tmp' and model.batch %} + {% set suffix = suffix ~ '_' ~ model.batch.id %} + {% endif %} + {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }} {% endmacro %} From a64351152f35bd474f740eba3900838502bf6f65 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Thu, 5 Dec 2024 01:46:11 +0000 Subject: [PATCH 2/2] Bumping version to 1.10.4 and generate changelog --- dbt/adapters/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index 977620c30..08e0d06bf 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.10.3" +version = "1.10.4"