Skip to content

Commit 00ebcb8

Browse files
datadersclrcrl
andauthored
Fix: Use timestamp macro in sequential values test for cross-db compatibility (#376)
* pending: pending: #354 * some db's dont have `timestamp` type * document * Update CHANGELOG.md Co-authored-by: Claire Carroll <20294432+clrcrl@users.noreply.github.com> Co-authored-by: Claire Carroll <carroll.claire.e@gmail.com>
1 parent 909f559 commit 00ebcb8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# dbt-utils v0.6.6
2+
3+
## Fixes
4+
5+
- make `sequential_values` schema test use `dbt_utils.type_timestamp()` to allow for compatibility with db's without timestamp data type. [#376](https://github.com/fishtown-analytics/dbt-utils/pull/376) from [@swanderz](https://github.com/swanderz)
16
# dbt-utils v0.6.5
27
## Features
38
* Add new `accepted_range` test ([#276](https://github.com/fishtown-analytics/dbt-utils/pull/276) [@joellabes](https://github.com/joellabes))

macros/schema_tests/sequential_values.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ validation_errors as (
2121
*
2222
from windowed
2323
{% if datepart %}
24-
where not(cast({{ column_name }} as timestamp)= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as timestamp))
24+
where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))
2525
{% else %}
2626
where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})
2727
{% endif %}

0 commit comments

Comments
 (0)