From 2bf38087bc7225dd2ffadc09fcfdc7fc781287fa Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Mon, 21 Oct 2024 10:26:55 -0400 Subject: [PATCH] Fix some typos in multiple unique_key (#335) --- .../macros/materializations/snapshots/helpers.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql index 5c2bad99..b4cd7c14 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -101,7 +101,7 @@ left outer join snapshotted_data on {{ unique_key_join_on(strategy.unique_key, "snapshotted_data", "source_data") }} where {{ unique_key_is_null(strategy.unique_key, "snapshotted_data") }} - or ({{ unique_key_is_not_null(strategy.unique_key, "snapshotted_data") }} and {{ strategy.row_changed }}) + or ({{ unique_key_is_not_null(strategy.unique_key, "snapshotted_data") }} and ({{ strategy.row_changed }}) ) @@ -230,8 +230,8 @@ {% macro unique_key_join_on(unique_key, identifier, from_identifier) %} - {% if strategy.unique_key | is_list %} - {% for key in strategy.unique_key %} + {% if unique_key | is_list %} + {% for key in unique_key %} {{ identifier }}.dbt_unique_key_{{ loop.index }} = {{ from_identifier }}.dbt_unique_key_{{ loop.index }} {%- if not loop.last %} and {%- endif %} {% endfor %} @@ -245,7 +245,7 @@ {% if unique_key | is_list %} {{ identifier }}.dbt_unique_key_1 is null {% else %} - {{ identifer }}.dbt_unique_key is null + {{ identifier }}.dbt_unique_key is null {% endif %} {% endmacro %} @@ -254,6 +254,6 @@ {% if unique_key | is_list %} {{ identifier }}.dbt_unique_key_1 is not null {% else %} - {{ identifer }}.dbt_unique_key is not null + {{ identifier }}.dbt_unique_key is not null {% endif %} {% endmacro %}