Skip to content

Commit

Permalink
Use backwards comaptible versions of timestamp macro
Browse files Browse the repository at this point in the history
  • Loading branch information
joellabes committed Oct 4, 2022
1 parent 25e4393 commit 4f7d3fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions integration_tests/models/generic_tests/test_recency.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
select
1 as col1,
2 as col2,
{{ date_trunc('day', current_timestamp()) }} as today
{{ date_trunc('day', current_timestamp_backcompat()) }} as today

{% else %}

select
1 as col1,
2 as col2,
cast({{ date_trunc('day', current_timestamp()) }} as datetime) as today
cast({{ date_trunc('day', current_timestamp_backcompat()) }} as datetime) as today

{% endif %}
2 changes: 1 addition & 1 deletion macros/generic_tests/recency.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}

{% set threshold = dateadd(datepart, interval * -1, current_timestamp()) %}
{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}
{% if group_by_columns|length() > 0 %}
{% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}
{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}
Expand Down

0 comments on commit 4f7d3fd

Please sign in to comment.