Skip to content

Commit 82c61bf

Browse files
committed
Release 0.9.7
1 parent 3db7cc2 commit 82c61bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+998
-714
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ Talk to our developers and other members of our growing community, get support a
8989
[View our contribution guidelines](CONTRIBUTING.md)
9090

9191
## License
92-
[Apache 2.0](LICENSE.md)
92+
[Apache 2.0](LICENSE)

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: automate_dv
2-
version: 0.9.5
2+
version: 0.9.7
33
require-dbt-version: [">=1.0.0", "<2.0.0"]
44
config-version: 2
55

macros/internal/helpers/dateadd.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
{% macro sqlserver__dateadd(datepart, interval, from_date_or_timestamp) %}
1919

2020
dateadd(
21-
millisecond,
22-
86399999,
21+
{{ datepart }},
22+
{{ interval }},
2323
CAST({{ from_date_or_timestamp }} AS DATETIME2)
2424
)
2525

macros/internal/helpers/stage_processing_macros/extract_column_names.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro extract_column_names(columns_dict=none) -%}
97

108
{%- set extracted_column_names = [] -%}

macros/internal/helpers/stage_processing_macros/extract_null_column_names.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro extract_null_column_names(columns_dict=none) -%}
97

108
{%- set extracted_column_names = [] -%}

macros/internal/helpers/stage_processing_macros/print_list.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro print_list(list_to_print=none, indent=4, columns_to_escape=none) -%}
97

108
{%- for col_name in list_to_print -%}

macros/internal/helpers/stage_processing_macros/process_columns_to_escape.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro process_columns_to_escape(derived_columns_list=none) -%}
97

108
{%- if derived_columns_list -%}

macros/internal/helpers/stage_processing_macros/process_columns_to_select.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro process_columns_to_select(columns_list=none, exclude_columns_list=none) -%}
97

108
{% set columns_list = columns_list | list %}

macros/internal/helpers/stage_processing_macros/process_hash_column_excludes.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
44
*/
55

6-
AutomateDV (f.k.a automate_dv)
7-
86
{%- macro process_hash_column_excludes(hash_columns=none, source_columns=none) -%}
97

108
{%- set processed_hash_columns = {} -%}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) Business Thinking Ltd. 2019-2023
3+
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
4+
*/
5+
6+
{% macro timestamp_add(datepart, interval, from_date_or_timestamp) %}
7+
{{ return(adapter.dispatch('timestamp_add', 'automate_dv')(datepart=datepart, interval=interval,
8+
from_date_or_timestamp=from_date_or_timestamp)) }}
9+
{%- endmacro -%}
10+
11+
{%- macro default__timestamp_add(datepart, interval, from_date_or_timestamp) -%}
12+
13+
{%- if datepart is in ['day', 'week', 'month', 'quarter', 'year'] -%}
14+
{{ automate_dv.dateadd('millisecond', 86399999, from_date_or_timestamp) }}
15+
{%- elif datepart == 'microsecond' -%}
16+
{{ automate_dv.dateadd('microsecond', 1, from_date_or_timestamp) }}
17+
{%- elif datepart == 'millisecond' -%}
18+
{{ automate_dv.dateadd('microsecond', 999, from_date_or_timestamp) }}
19+
{%- elif datepart == 'second' -%}
20+
{{ automate_dv.dateadd('millisecond', 999, from_date_or_timestamp) }}
21+
{%- elif datepart == 'minute' -%}
22+
{{ automate_dv.dateadd('millisecond', 5999, from_date_or_timestamp) }}
23+
{%- elif datepart == 'hour' -%}
24+
{{ automate_dv.dateadd('millisecond', 3599999, from_date_or_timestamp) }}
25+
{%- endif -%}
26+
27+
{%- endmacro -%}
28+
29+
{% macro bigquery__timestamp_add(datepart, interval, from_date_or_timestamp) %}
30+
31+
{%- if datepart is in ['day', 'week', 'month', 'quarter', 'year'] -%}
32+
{{ automate_dv.dateadd('millisecond', 86399999, from_date_or_timestamp) }}
33+
{%- elif datepart == 'microsecond' -%}
34+
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 1 microsecond)
35+
{%- elif datepart == 'millisecond' -%}
36+
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 999 microsecond)
37+
{%- elif datepart == 'second' -%}
38+
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 999 millisecond)
39+
{%- elif datepart == 'minute' -%}
40+
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 5999 millisecond)
41+
{%- elif datepart == 'hour' -%}
42+
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 3599999 millisecond)
43+
{%- endif -%}
44+
45+
{% endmacro %}
46+
47+

0 commit comments

Comments
 (0)