Skip to content

Commit

Permalink
Release 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DVAlexHiggs committed Jun 7, 2024
2 parents f3d29cd + de32631 commit 6a929dc
Show file tree
Hide file tree
Showing 119 changed files with 727 additions and 1,005 deletions.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AutomateDV (f.k.a dbtvault)
Copyright 2019-2023 Business Thinking Ltd (Trading as Datavault).
Copyright 2019-2024 Business Thinking Ltd (Trading as Datavault).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 8 additions & 8 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: automate_dv
version: 0.10.2
require-dbt-version: [">=1.0.0", "<2.0.0"]
version: 0.11.0
require-dbt-version: [ ">=1.0.0", "<2.0.0" ]
config-version: 2

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
docs-paths: ["docs"]
model-paths: [ "models" ]
analysis-paths: [ "analyses" ]
test-paths: [ "tests" ]
seed-paths: [ "seeds" ]
macro-paths: [ "macros" ]
docs-paths: [ "docs" ]

target-path: "target"
clean-targets:
Expand Down
2 changes: 1 addition & 1 deletion macros/internal/helpers/dateadd.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/helpers/is_checks.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/


{% macro wrap_warning(warning_message) %}

{%- set new_message = [] -%}
{%- set length_list = [] -%}

{%- for ln in warning_message.split('\n') -%}
{%- do new_message.append((ln | trim)) -%}
{%- do length_list.append((ln | length)) -%}
{%- endfor -%}

{%- set max_line_length = length_list | max -%}
{%- set padding_length = (max_line_length - 7) // 2 -%}

{%- set border = modules.itertools.repeat('=', padding_length) | join ('') ~ 'WARNING' ~ modules.itertools.repeat('=', padding_length) | join ('') -%}

{%- set wrapped_message = '\n' ~ border ~ '\n' ~ new_message | join('\n') ~ '\n' ~ border -%}

{%- do return(wrapped_message) -%}

{% endmacro %}


{%- macro datepart_too_small_error(period) -%}

{%- set message -%}
Expand All @@ -35,10 +13,7 @@
Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/
{%- endset -%}

{%- if execute -%}
{{- exceptions.raise_compiler_error(message) -}}
{%- endif -%}

{%- do automate_dv.log_error(message) -%}
{%- endmacro -%}


Expand All @@ -51,10 +26,7 @@
Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/
{%- endset -%}

{%- if execute -%}
{{- exceptions.warn(automate_dv.wrap_warning(message)) -}}
{%- endif -%}

{%- do automate_dv.log_warning(message) -%}
{%- endmacro -%}


Expand All @@ -67,10 +39,7 @@
Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/
{%- endset %}

{%- if execute -%}
{{- exceptions.raise_compiler_error(message) -}}
{%- endif -%}

{%- do automate_dv.log_warning(message) -%}
{%- endmacro -%}


Expand All @@ -82,10 +51,7 @@
Using this functionality in a live production setting may result in unpredictable outcomes, data loss, or system instability.
{%- endset -%}

{%- if execute -%}
{{- exceptions.warn(automate_dv.wrap_warning(message)) -}}
{%- endif -%}

{%- do automate_dv.log_warning(message) -%}
{%- endmacro -%}


Expand All @@ -99,8 +65,32 @@
We are actively working to get this fixed. Thank you for your understanding.
{%- endset -%}

{%- if execute -%}
{{- exceptions.raise_compiler_error(automate_dv.wrap_warning(message)) -}}
{%- endif -%}
{%- do automate_dv.log_error(message) -%}
{%- endmacro -%}


{%- macro materialisation_deprecation_warning() -%}

{%- set message -%}
DEPRECATED: Since AutomateDV v0.11.0, vault_insert_by_x materialisations are now deprecated.
These materialisation were initially designed to provide an option for rapid iterative development of
incremental loading patterns in local environments for development and testing, allowing users to bypass
the need for a comprehensive PSA or delta-loading solution. They are being deprecated to encourage the use
of more robust solutions.
{%- endset -%}

{%- do automate_dv.log_warning(message) -%}
{%- endmacro -%}


{%- macro pit_bridge_deprecation_warning() -%}

{%- set message -%}
DEPRECATED: Since AutomateDV v0.11.0, the pit() and bridge() macros are now deprecated.
This is because they are not currently fit-for-purpose and need significant usability
and peformance improvements, as well as a design overhaul.
Improved implementations will be released in a future version of AutomateDV.
{%- endset -%}

{%- do automate_dv.log_warning(message) -%}
{%- endmacro -%}
6 changes: 3 additions & 3 deletions macros/internal/helpers/logging/log_relation_sources.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand All @@ -9,7 +9,7 @@

{% macro default__log_relation_sources(relation, source_count) %}

{%- if 'docs' not in invocation_args_dict['rpc_method'] and execute -%}
{%- if execute and automate_dv.is_something(invocation_args_dict.get('which')) and invocation_args_dict.get('which') != 'docs' -%}

{%- do dbt_utils.log_info('Loading {} from {} source(s)'.format("{}.{}.{}".format(relation.database, relation.schema, relation.identifier),
source_count)) -%}
Expand All @@ -18,7 +18,7 @@

{% macro databricks__log_relation_sources(relation, source_count) %}

{%- if 'docs' not in invocation_args_dict['rpc_method'] and execute -%}
{%- if execute and automate_dv.is_something(invocation_args_dict.get('which')) and invocation_args_dict.get('which') != 'docs' -%}

{%- do dbt_utils.log_info('Loading {} from {} source(s)'.format("{}.{}".format(relation.schema, relation.identifier),
source_count)) -%}
Expand Down
48 changes: 48 additions & 0 deletions macros/internal/helpers/logging/logging_helpers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/


{% macro wrap_message(message, type='WARNING') %}

{%- set new_message = [] -%}
{%- set length_list = [] -%}

{%- for ln in message.split('\n') -%}
{%- do new_message.append((ln | trim)) -%}
{%- do length_list.append((ln | length)) -%}
{%- endfor -%}

{%- set max_line_length = length_list | max -%}
{%- set padding_length = (max_line_length - 7) // 2 -%}

{%- set border = modules.itertools.repeat('=', padding_length) | join ('') ~ (type | upper) ~ modules.itertools.repeat('=', padding_length) | join ('') -%}

{%- set wrapped_message = '\n' ~ border ~ '\n' ~ new_message | join('\n') ~ '\n' ~ border -%}

{%- do return(wrapped_message) -%}

{% endmacro %}


{%- macro log_warning(message) -%}

{%- set message = automate_dv.wrap_message(message) -%}

{%- if execute and automate_dv.is_something(invocation_args_dict.get('which')) and invocation_args_dict.get('which') != 'compile' -%}
{%- do exceptions.warn(message) -%}
{%- endif -%}

{%- endmacro -%}


{%- macro log_error(message) -%}

{%- set message = automate_dv.wrap_message(message, type='ERROR') -%}

{%- if execute and automate_dv.is_something(invocation_args_dict.get('which')) and invocation_args_dict.get('which') != 'compile' -%}
{%- do exceptions.raise_compiler_error(message) -%}
{%- endif -%}

{%- endmacro -%}
2 changes: 1 addition & 1 deletion macros/internal/helpers/prepend_generated_by.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/helpers/timestamp_add.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/alias.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/alias_all.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/as_constant.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
22 changes: 19 additions & 3 deletions macros/internal/metadata_processing/concat_ws.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand All @@ -11,6 +11,16 @@

{%- macro default__concat_ws(string_list, separator="||") -%}

CONCAT_WS('{{ separator }}',
{%- for str_obj in string_list %}
{{ str_obj }}{% if not loop.last %},{% endif %}
{%- endfor %}
)

{%- endmacro -%}

{%- macro bigquery__concat_ws(string_list, separator="||") -%}

CONCAT(
{%- for str in string_list %}
{{ str }}
Expand All @@ -20,13 +30,19 @@ CONCAT(

{%- endmacro -%}

{%- macro bigquery__concat_ws(string_list, separator="||") -%}
{%- macro sqlserver__concat_ws(string_list, separator="||") -%}

{{ automate_dv.default__concat_ws(string_list=string_list, separator=separator) }}

{%- endmacro -%}

{%- macro sqlserver__concat_ws(string_list, separator="||") -%}
{%- macro postgres__concat_ws(string_list, separator="||") -%}

{{ automate_dv.default__concat_ws(string_list=string_list, separator=separator) }}

{%- endmacro -%}

{%- macro databricks__concat_ws(string_list, separator="||") -%}

{{ automate_dv.default__concat_ws(string_list=string_list, separator=separator) }}

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/escape_column_name.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/expand_column_list.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
2 changes: 1 addition & 1 deletion macros/internal/metadata_processing/multikey.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Business Thinking Ltd. 2019-2023
* Copyright (c) Business Thinking Ltd. 2019-2024
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault
*/

Expand Down
Loading

0 comments on commit 6a929dc

Please sign in to comment.