Skip to content

Commit

Permalink
Merge pull request #2259 from jeremyyeo/fix/warn-exception-sql-compil…
Browse files Browse the repository at this point in the history
…ation

Make warn return empty string (#2222)
  • Loading branch information
beckjake authored Mar 30, 2020
2 parents 5c69890 + f5d358d commit 78f1afa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:/fishtown-analytics/dbt/issues/2110), [#2184](https:/fishtown-analytics/dbt/pull/2184))
- Added timeout to registry download call ([#2195](https:/fishtown-analytics/dbt/issues/2195), [#2228](https:/fishtown-analytics/dbt/pull/2228))
- When a macro is called with invalid arguments, include the calling model in the output ([#2073](https:/fishtown-analytics/dbt/issues/2073), [#2238](https:/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:/fishtown-analytics/dbt/issues/2222), [#2259](https:/fishtown-analytics/dbt/pull/2259))

Contributors:
- [@raalsky](https:/Raalsky) ([#2224](https:/fishtown-analytics/dbt/pull/2224), [#2228](https:/fishtown-analytics/dbt/pull/2228))
- [@ilkinulas](https:/ilkinulas) [#2199](https:/fishtown-analytics/dbt/pull/2199)

- [@jeremyyeo](https:/jeremyyeo) [#2259](https:/fishtown-analytics/dbt/pull/2259)

## dbt 0.16.0 (March 23, 2020)

Expand Down
3 changes: 2 additions & 1 deletion core/dbt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 78f1afa

Please sign in to comment.