-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dbt Core 1.2 and utils 0.9.0 prep #625
Changes from 4 commits
45acc12
af9d70a
b586999
e59cf1d
475dea2
34670af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 -%} |
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 %} |
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 %} |
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 %} |
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 %} |
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 %} |
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 no longer available in dbt_utils and backwards compatibility will be removed in a future version. Use `dbt." ~ macro ~ "` instead. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%} | ||||||||||||||||||
{%- do exceptions.warn(error_message) -%} | ||||||||||||||||||
{% endmacro %} | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jtcohen6 and I decided here to omit the I feel the public-facing documentation and the deprecation warning should be in tight alignment; it's confusing for end users when they differ. There are two different permissible options here (with
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I 💯 agree with your desire for consistency of advice, especially for the exact same functions. Ideally that should be true for all macros across the board, which would mean that we should have no BUT. My gut feeling on why these ones are different is that they get a bit uncanny-valley-y. If I am new to dbt, then coming across If we do This sort of matches up with something else I've been thinking of, which is the shorthand node selection syntax being the same for a package or a model or a directory ( If you or jerco feel very strongly in the opposite direction, I'm willing to be talked around. I just like to know where my magic is coming from 🐰🎩 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jerco and I both considered the two options and decided on the version that is shorter to read and write and aligns with Since we both had the same preference, we didn't discuss it in detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this will drop the
-rc1
suffix and flip to just>=1.2.0
prior to the final release of dbt_utils 0.9.0?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!