diff --git a/macros/cross_db_utils/identifier.sql b/macros/cross_db_utils/identifier.sql index 5c337369..ede09f66 100644 --- a/macros/cross_db_utils/identifier.sql +++ b/macros/cross_db_utils/identifier.sql @@ -1,5 +1,9 @@ {% macro identifier(value) %} - {% do exceptions.warn("Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use `adapter.quote` instead") %} + {%- set error_message = ' + Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \ + Use `adapter.quote` instead. The {}.{} model triggered this warning. \ + '.format(model.package_name, model.name) -%} + {%- do exceptions.warn(error_message) -%} {{ adapter_macro('dbt_utils.identifier', value) }} {% endmacro %} @@ -9,4 +13,4 @@ {% macro bigquery__identifier(value) -%} `{{ value }}` -{%- endmacro %} \ No newline at end of file +{%- endmacro %} diff --git a/macros/sql/get_relations_by_prefix.sql b/macros/sql/get_relations_by_prefix.sql index 9d143f16..895ec795 100644 --- a/macros/sql/get_relations_by_prefix.sql +++ b/macros/sql/get_relations_by_prefix.sql @@ -23,8 +23,12 @@ {% endmacro %} {% macro get_tables_by_prefix(schema, prefix, exclude='', database=target.database) %} - - {% do exceptions.warn("Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `get_relations_by_prefix` macro instead") %} + {%- set error_message = ' + Warning: the `get_tables_by_prefix` macro is no longer supported and will be deprecated in a future release of dbt-utils. \ + Use the `get_relations_by_prefix` macro instead. \ + The {}.{} model triggered this warning. \ + '.format(model.package_name, model.name) -%} + {%- do exceptions.warn(error_message) -%} {{ return(dbt_utils.get_relations_by_prefix(schema, prefix, exclude, database)) }} diff --git a/macros/sql/surrogate_key.sql b/macros/sql/surrogate_key.sql index 04d38e23..b992c733 100644 --- a/macros/sql/surrogate_key.sql +++ b/macros/sql/surrogate_key.sql @@ -2,7 +2,13 @@ {%- if varargs|length >= 1 or field_list is string %} -{%- do exceptions.warn("Warning: the `surrogate_key` macro now takes a single list argument instead of multiple string arguments. Support for multiple string arguments will be deprecated in a future release of dbt-utils.") -%} +{%- set error_message = ' +Warning: the `surrogate_key` macro now takes a single list argument instead of \ +multiple string arguments. Support for multiple string arguments will be \ +deprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \ +'.format(model.package_name, model.name) -%} + +{%- do exceptions.warn(error_message) -%} {# first argument is not included in varargs, so add first element to field_list_xf #} {%- set field_list_xf = [field_list] -%} diff --git a/macros/sql/union.sql b/macros/sql/union.sql index 8dbd40f6..b6956f70 100644 --- a/macros/sql/union.sql +++ b/macros/sql/union.sql @@ -85,8 +85,12 @@ {%- endmacro -%} {%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%} - - {%- do exceptions.warn("Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead") -%} + {%- set error_message = ' + Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. \ + Use the `union_relations` macro instead. \ + The {}.{} model triggered this warning. \ + '.format(model.package_name, model.name) -%} + {%- do exceptions.warn(error_message) -%} {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }} diff --git a/macros/sql/unpivot.sql b/macros/sql/unpivot.sql index 34426e47..de1a1b5c 100644 --- a/macros/sql/unpivot.sql +++ b/macros/sql/unpivot.sql @@ -15,7 +15,12 @@ Arguments: {% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%} {% if table %} - {% do exceptions.warn("Warning: the `unpivot` macro no longer accepts a `table` parameter. This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead") %} + {%- set error_message = ' + Warning: the `unpivot` macro no longer accepts a `table` parameter. \ + This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \ + The {}.{} model triggered this warning. \ + '.format(model.package_name, model.name) -%} + {%- do exceptions.warn(error_message) -%} {% endif %} {% if relation and table %}