Skip to content

Commit

Permalink
Check both dbt_valid_to_current and null
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Sep 27, 2024
1 parent a684080 commit 9defe6b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text
and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)
{% if config.get("dbt_valid_to_current") %}
and {{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }};
and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);
{% else %}
and {{ target }}.{{ columns.dbt_valid_to }} is null;
{% endif %}
Expand Down

0 comments on commit 9defe6b

Please sign in to comment.