Skip to content

Commit d843779

Browse files
Update dbt_utils dependency to v1.0.0 (#108)
* feat(update dbt_utils version and surrogate_key syntax) * feat(refactor dbt.current_timestamp) * feat(refactor dbt.current_timestamp_backcompat) * feat(refactor unify dbt.current_timestamp_backcompat invoke method) * feat(update dbt_utils dependencies)
1 parent 07f2cc3 commit d843779

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

models/alerts/re_data_schema_changes.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@
143143
all_changes.prev_column_name,
144144
all_changes.prev_data_type,
145145
all_changes.prev_is_nullable,
146-
cast({{dbt_utils.current_timestamp_in_utc()}} as {{ timestamp_type() }}) as detected_time
146+
cast({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }}) as detected_time
147147
from all_changes
148148
)
149149

150150
select
151-
cast ({{ dbt_utils.surrogate_key([
151+
cast ({{ dbt_utils.generate_surrogate_key([
152152
'table_name',
153153
'column_name',
154154
'detected_time'

models/alerts/re_data_z_score.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ with z_score_without_id as (
3030
stats.last_first_quartile,
3131
stats.last_third_quartile,
3232
{{ time_window_end() }} as time_window_end,
33-
cast( {{dbt_utils.current_timestamp_in_utc()}} as {{ timestamp_type() }} ) as computed_on
33+
cast( {{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }} ) as computed_on
3434
from
3535
{{ ref('re_data_last_stats') }} as stats,
3636
{{ ref('re_data_last_metrics') }} as last_metric
@@ -48,7 +48,7 @@ with z_score_without_id as (
4848
)
4949

5050
select
51-
cast ({{ dbt_utils.surrogate_key([
51+
cast ({{ dbt_utils.generate_surrogate_key([
5252
'table_name',
5353
'column_name',
5454
'metric',

models/meta/re_data_columns.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
cast (column_name as {{ string_type() }} ) as column_name,
2828
cast (data_type as {{ string_type() }} ) as data_type,
2929
cast (case is_nullable when 'YES' then 1 else 0 end as {{ boolean_type() }} ) as is_nullable,
30-
cast ({{- dbt_utils.current_timestamp_in_utc() -}} as {{ timestamp_type() }}) as computed_on
30+
cast ({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }}) as computed_on
3131
from columns_from_select
3232

3333
{% else %}

models/metrics/types/base/re_data_base_metrics.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ with_time_window as (
3434
{% endfor %}
3535
)
3636
select
37-
cast ({{ dbt_utils.surrogate_key([
37+
cast ({{ dbt_utils.generate_surrogate_key([
3838
'table_name',
3939
'column_name',
4040
'metric',
@@ -50,5 +50,5 @@ select
5050
cast (
5151
{{ interval_length_sec('time_window_start', 'time_window_end') }} as {{ integer_type() }}
5252
) as interval_length_sec,
53-
cast ({{- dbt_utils.current_timestamp_in_utc() -}} as {{ timestamp_type() }}) as computed_on
53+
cast ({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }}) as computed_on
5454
from with_time_window

models/metrics/types/samples/re_data_table_samples.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
select
1313
table_name,
1414
sample_data,
15-
cast ({{- dbt_utils.current_timestamp_in_utc() -}} as {{ timestamp_type() }}) as sampled_on
15+
cast ({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }}) as sampled_on
1616

1717
from {{ ref('re_data_last_table_samples_part') }}

models/metrics/types/schema/re_data_columns_over_time.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ select
1414
cols.column_name,
1515
cols.data_type,
1616
cols.is_nullable,
17-
cast ({{dbt_utils.current_timestamp_in_utc()}} as {{ timestamp_type() }} ) as detected_time
17+
cast ({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }} ) as detected_time
1818
from
1919
{{ ref('re_data_columns')}} cols, {{ ref('re_data_selected')}} tables
2020
where
2121
cols.name = tables.name and cols.schema = tables.schema and cols.database = tables.database
2222
)
2323

2424
select
25-
cast ({{ dbt_utils.surrogate_key([
25+
cast ({{ dbt_utils.generate_surrogate_key([
2626
'table_name',
2727
'column_name',
2828
'detected_time'

packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
packages:
33
- package: dbt-labs/dbt_utils
4-
version: [">=0.7.0", "<1.0.0"]
4+
version: [">=1.0.0", "<1.1.0"]

0 commit comments

Comments
 (0)