From 7a9e069a386c4b9422569fb9a2e4b83b75f95a20 Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Wed, 25 Sep 2024 18:18:34 -0400 Subject: [PATCH] Change name of config field --- .../macros/materializations/snapshots/helpers.sql | 6 +++--- .../macros/materializations/snapshots/snapshot_merge.sql | 4 ++-- 2 files 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 6f13ddb9..1183c9f4 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -40,8 +40,8 @@ {% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%} {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %} - {% if config.get('dbt_valid_to_current_date') %} - {% set valid_to_expr = " = " ~ config.get('dbt_valid_to_current_date') %} + {% if config.get('dbt_valid_to_current') %} + {% set valid_to_expr = " = " ~ config.get('dbt_valid_to_current') %} {% else %} {% set valid_to_expr = " is null " %} {% endif %} @@ -217,7 +217,7 @@ {% endmacro %} {% macro get_dbt_valid_to_current(strategy, columns) %} - {% set dbt_valid_to_current = config.get('dbt_valid_to_current_date') or "null" %} + {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or "null" %} {% do log("dbt_valid_to_current = " ~ dbt_valid_to_current, info=true) %} coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}}) as {{ columns.dbt_valid_to }} diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index ee57c429..fcd892f9 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -14,8 +14,8 @@ on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }} when matched - {% if config.get("dbt_valid_to_current_date") %} - and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current_date') }} + {% if config.get("dbt_valid_to_current") %} + and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null {% endif %}