diff --git a/CHANGELOG.md b/CHANGELOG.md index 523b8f309d0..e1189040620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,12 @@ - When a jinja value is undefined, give a helpful error instead of failing with cryptic "cannot pickle ParserMacroCapture" errors ([#2110](https://github.com/fishtown-analytics/dbt/issues/2110), [#2184](https://github.com/fishtown-analytics/dbt/pull/2184)) - Added timeout to registry download call ([#2195](https://github.com/fishtown-analytics/dbt/issues/2195), [#2228](https://github.com/fishtown-analytics/dbt/pull/2228)) - When a macro is called with invalid arguments, include the calling model in the output ([#2073](https://github.com/fishtown-analytics/dbt/issues/2073), [#2238](https://github.com/fishtown-analytics/dbt/pull/2238)) +- When a warn exception is not in a jinja do block, return an empty string instead of None ([#2222](https://github.com/fishtown-analytics/dbt/issues/2222), [#2259](https://github.com/fishtown-analytics/dbt/pull/2259)) Contributors: - [@raalsky](https://github.com/Raalsky) ([#2224](https://github.com/fishtown-analytics/dbt/pull/2224), [#2228](https://github.com/fishtown-analytics/dbt/pull/2228)) - [@ilkinulas](https://github.com/ilkinulas) [#2199](https://github.com/fishtown-analytics/dbt/pull/2199) - + - [@jeremyyeo](https://github.com/jeremyyeo) [#2259](https://github.com/fishtown-analytics/dbt/pull/2259) ## dbt 0.16.0 (March 23, 2020) diff --git a/core/dbt/exceptions.py b/core/dbt/exceptions.py index e7e0cae9445..6aac220c88b 100644 --- a/core/dbt/exceptions.py +++ b/core/dbt/exceptions.py @@ -819,7 +819,8 @@ def warn_or_raise(exc, log_fmt=None): def warn(msg, node=None): # there's no reason to expose log_fmt to macros - it's only useful for # handling colors - return warn_or_error(msg, node=node) + warn_or_error(msg, node=node) + return "" # Update this when a new function should be added to the diff --git a/test/integration/013_context_var_tests/emit-warning-models/warnings.sql b/test/integration/013_context_var_tests/emit-warning-models/warnings.sql index 1b5f33278a8..078e66c9bdf 100644 --- a/test/integration/013_context_var_tests/emit-warning-models/warnings.sql +++ b/test/integration/013_context_var_tests/emit-warning-models/warnings.sql @@ -1,2 +1,3 @@ {% do exceptions.warn('warning: everything is terrible but not that terrible') %} +{{ exceptions.warn("warning: everything is terrible but not that terrible") }} select 1 as id