Skip to content

Commit

Permalink
Use warning_tag for deprecations too
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Dec 2, 2021
1 parent 3ec5f65 commit ff994b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/dbt/deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def show(self, *args, **kwargs) -> None:
if self.name not in active_deprecations:
desc = self.description.format(**kwargs)
msg = ui.line_wrap_message(
desc, prefix='* Deprecation Warning:\n\n'
desc, prefix='Deprecated functionality\n\n'
)
dbt.exceptions.warn_or_error(msg)
dbt.exceptions.warn_or_error(msg, log_fmt=ui.warning_tag('{}'))
self.track_deprecation_warn()
active_deprecations.add(self.name)

Expand All @@ -62,7 +62,7 @@ class PackageInstallPathDeprecation(DBTDeprecation):

class ConfigPathDeprecation(DBTDeprecation):
_description = '''\
The `{deprecated_path}` config has been deprecated in favor of `{exp_path}`.
The `{deprecated_path}` config has been renamed to `{exp_path}`.
Please update your `dbt_project.yml` configuration to reflect this change.
'''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_postgres_data_path_fail(self):
with self.assertRaises(dbt.exceptions.CompilationException) as exc:
self.run_dbt(['--warn-error', 'debug'])
exc_str = ' '.join(str(exc.exception).split()) # flatten all whitespace
expected = "The `data-paths` config has been deprecated"
expected = "The `data-paths` config has been renamed"
assert expected in exc_str


Expand Down

0 comments on commit ff994b9

Please sign in to comment.