Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exceptions.warn to the dbt context (#1970) #1977

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented Dec 4, 2019

Fixes #1970

Add a warn function to exceptions.py and export it. It is basically warn_or_error, but without the log_fmt parameter. That parameter is only used internally, and jinja can already do text formatting pretty well so it doesn't serve much purpose.

I'm not attached to the name in any way.

@cla-bot cla-bot bot added the cla:yes label Dec 4, 2019
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go for warn instead of emit_warning. This LGTM after that's addressed!

@@ -0,0 +1,2 @@
{% do exceptions.emit_warning('warning: everything is terrible but not that terrible') %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@@ -756,12 +756,19 @@ def warn_or_raise(exc, log_fmt=None):
logger.warning(msg)


def emit_warning(msg, node=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just call this warn?

@beckjake beckjake changed the title add exceptions.emit_warning to the dbt context (#1970) add exceptions.warn to the dbt context (#1970) Dec 5, 2019
@beckjake beckjake merged commit 65b4c18 into dev/0.15.1 Dec 5, 2019
@beckjake beckjake deleted the feature/emit-warning-context branch December 5, 2019 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide an interface to throw warnings
2 participants