Skip to content

Commit

Permalink
Revert original fix which is no longer needed. Add a slightly-paranoi…
Browse files Browse the repository at this point in the history
…d check to minimize any chance of regressions.
  • Loading branch information
peterallenwebb committed Dec 19, 2024
1 parent e0a786b commit 55dda7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@

{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}
{% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}
{% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}
{% if strategy.hard_deletes == 'new_record' %}
{% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}
{% endif %}
with snapshot_query as (

{{ source_sql }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

merge into {{ target.render() }} as DBT_INTERNAL_DEST
using {{ source }} as DBT_INTERNAL_SOURCE
on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }} and DBT_INTERNAL_SOURCE.dbt_change_type != 'insert'
on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}

when matched
{% if config.get("dbt_valid_to_current") %}
Expand Down

0 comments on commit 55dda7e

Please sign in to comment.