Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianburusdbt committed Dec 17, 2024
1 parent 7565dea commit d582ab1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% endfor %}
{% else %}
{% set unique_key_match %}
{{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }}
{{ equals(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }}
{% endset %}
{% do predicates.append(unique_key_match) %}
{% endif %}
Expand Down Expand Up @@ -66,7 +66,7 @@
using {{ source }}
where (
{% for key in unique_key %}
{{ adapter.dispatch('equals', 'dbt')({{ source }}.{{ key }}, {{ target }}.{{ key }}) }}
{{ equals({{ source }}.{{ key }}, {{ target }}.{{ key }}) }}
{{ "and " if not loop.last}}
{% endfor %}
{% if incremental_predicates %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from {{ target_relation }}
where
{% if config.get('dbt_valid_to_current') %}
{{ adapter.dispatch('equals', 'dbt')({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }}
{{ equals({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }}
{% else %}
{{ columns.dbt_valid_to }} is null
{% endif %}
Expand Down Expand Up @@ -275,7 +275,7 @@
{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}
{% if unique_key | is_list %}
{% for key in unique_key %}
{{ adapter.dispatch('equals', 'dbt')({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }}
{{ equals({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }}
{%- if not loop.last %} and {%- endif %}
{% endfor %}
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

when matched
{% if config.get("dbt_valid_to_current") %}
and {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }}
and {{ equals(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }}

{% else %}
and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null
Expand Down
2 changes: 1 addition & 1 deletion dbt/include/global_project/macros/utils/equals.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% macro equals(first_date, second_date, datepart) %}
{% macro equals(expr1, expr2) %}
{{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}
{%- endmacro %}

Expand Down

0 comments on commit d582ab1

Please sign in to comment.