forked from dbt-labs/dbt-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap xdb warnings in if execute block
- Loading branch information
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql
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,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 %} |