Skip to content

Commit

Permalink
Wrap xdb warnings in if execute block
Browse files Browse the repository at this point in the history
  • Loading branch information
joellabes committed Oct 27, 2022
1 parent 586f278 commit b08f7bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{% 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 `dbt." ~ macro ~ "` instead. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%}
{%- do exceptions.warn(error_message) -%}
{% if execute %}
{%- 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 `dbt." ~ macro ~ "` instead. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%}
{%- do exceptions.warn(error_message) -%}
{% endif %}
{% endmacro %}

{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}
{%- set error_message = "Warning: the `" ~ macro ~"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%}
{%- do exceptions.warn(error_message) -%}
{% if execute %}
{%- set error_message = "Warning: the `" ~ macro ~"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The " ~ package ~ "." ~ model ~ " model triggered this warning." -%}
{%- do exceptions.warn(error_message) -%}
{% endif %}
{% endmacro %}

0 comments on commit b08f7bb

Please sign in to comment.