-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbt Core 1.2 and utils 0.9.0 prep (#625)
* Add cross-db deprecation warnings to all migrated macros * Require core 1.2-rc1 or higher * Warn about removal of insert_by_period * Update insert_by_period_materialization.sql * Remove `dbt.` prefix from code review * 1.2 final is out so remove rc1 reference
- Loading branch information
Showing
24 changed files
with
34 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro any_value(expression) -%} | ||
{{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__any_value(expression) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('any_value', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('any_value', 'dbt') (expression)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro bool_or(expression) -%} | ||
{{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__bool_or(expression) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('bool_or', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro cast_bool_to_text(field) %} | ||
{{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }} | ||
{% endmacro %} | ||
|
||
{% macro default__cast_bool_to_text(field) %} | ||
{% do dbt_utils.xdb_deprecation_warning('cast_bool_to_text', model.package_name, model.name) %} | ||
{{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro concat(fields) -%} | ||
{{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__concat(fields) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('concat', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('concat', 'dbt')(fields)) }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro date_trunc(datepart, date) -%} | ||
{{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__date_trunc(datepart, date) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('date_trunc', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro dateadd(datepart, interval, from_date_or_timestamp) %} | ||
{{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %} | ||
{% do dbt_utils.xdb_deprecation_warning('dateadd', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro datediff(first_date, second_date, datepart) %} | ||
{{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__datediff(first_date, second_date, datepart) %} | ||
{% do dbt_utils.xdb_deprecation_warning('datediff', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro escape_single_quotes(expression) %} | ||
{{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__escape_single_quotes(expression) %} | ||
{% do dbt_utils.xdb_deprecation_warning('escape_single_quotes', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro except() %} | ||
{{ return(adapter.dispatch('except', 'dbt_utils')()) }} | ||
{% endmacro %} | ||
|
||
{% macro default__except() %} | ||
{% do dbt_utils.xdb_deprecation_warning('except', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('except', 'dbt')()) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro hash(field) -%} | ||
{{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__hash(field) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('hash', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('hash', 'dbt') (field)) }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro intersect() %} | ||
{{ return(adapter.dispatch('intersect', 'dbt_utils')()) }} | ||
{% endmacro %} | ||
|
||
{% macro default__intersect() %} | ||
{% do dbt_utils.xdb_deprecation_warning('intersect', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('intersect', 'dbt')()) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro length(expression) -%} | ||
{{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__length(expression) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('length', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('length', 'dbt') (expression)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro listagg(measure, delimiter_text="','", order_by_clause=none, limit_num=none) -%} | ||
{{ return(adapter.dispatch('listagg', 'dbt_utils') (measure, delimiter_text, order_by_clause, limit_num)) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__listagg(measure, delimiter_text="','", order_by_clause=none, limit_num=none) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('listagg', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{%- macro string_literal(value) -%} | ||
{{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }} | ||
{%- endmacro -%} | ||
|
||
{%- macro default__string_literal(value) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('string_literal', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('string_literal', 'dbt') (value)) }} | ||
{%- endmacro -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro position(substring_text, string_text) -%} | ||
{{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__position(substring_text, string_text) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('position', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro replace(field, old_chars, new_chars) -%} | ||
{{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__replace(field, old_chars, new_chars) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('replace', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro right(string_text, length_expression) -%} | ||
{{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__right(string_text, length_expression) -%} | ||
{% do dbt_utils.xdb_deprecation_warning('right', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro safe_cast(field, type) %} | ||
{{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__safe_cast(field, type) %} | ||
{% do dbt_utils.xdb_deprecation_warning('safe_cast', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{# This is here for backwards compatibility only #} | ||
|
||
{% macro split_part(string_text, delimiter_text, part_number) %} | ||
{{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__split_part(string_text, delimiter_text, part_number) %} | ||
{% do dbt_utils.xdb_deprecation_warning('split_part', model.package_name, model.name) %} | ||
{{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% macro xdb_deprecation_warning(macro, package, model) %} | ||
{%- set error_message = "Warning: the `" ~ macro ~"` macro is now provided in dbt Core. It is no longer available in dbt_utils and backwards compatibility will be removed in a future version of the package. Use `" ~ macro ~ "` (no prefix) instead. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%} | ||
{%- do exceptions.warn(error_message) -%} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters