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

[#4006] replace logger.warning with warn_or_error #4019

Merged

Conversation

laxjesse
Copy link
Contributor

@laxjesse laxjesse commented Oct 7, 2021

resolves #4006

Description

Uses warn_or_error to log or raise errors depending on arguments passed.

It wasn't 100% clear to me if there should be a test for this or not but I'm happy to add if there should be.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot
Copy link

cla-bot bot commented Oct 7, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @laxjesse

@laxjesse laxjesse changed the title replace logger.warning with warn_or_error [#4006] replace logger.warning with warn_or_error Oct 7, 2021
@laxjesse
Copy link
Contributor Author

laxjesse commented Oct 7, 2021

I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

I'm not totally sure where (or if I even should!) be adding info in CHANGELOG.md, so a bit of clarification would be appreciated 🙂

I have signed the CLA

checking with my company to make sure they won't yell at me for signing this

@jtcohen6
Copy link
Contributor

jtcohen6 commented Oct 7, 2021

@laxjesse You can add a changelog entry under 1.0.0, in the Fixes section, and add yourself to the list of Contributors below that :)

As soon as you can sign the CLA, I can give this PR a review! Looking good from a first glance.

@laxjesse laxjesse force-pushed the 4006_replace_logg_with_warn_error branch from 84ebad6 to 62f775a Compare October 7, 2021 20:49
@cla-bot cla-bot bot added the cla:yes label Oct 7, 2021
Uses `warn_or_error` to log _or_ raise errors depending on arguments
passed.
@laxjesse laxjesse force-pushed the 4006_replace_logg_with_warn_error branch from 62f775a to 1147aa0 Compare October 7, 2021 20:52
@laxjesse
Copy link
Contributor Author

laxjesse commented Oct 7, 2021

integration-postgres run-test: commands[1] | /home/runner/work/dbt/dbt/.tox/integration-postgres/bin/python -m pytest --profile=postgres test/rpc
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --profile=postgres
  inifile: /home/runner/work/dbt/dbt/tox.ini
  rootdir: /home/runner/work/dbt/dbt

ERROR: InvocationError for command /home/runner/work/dbt/dbt/.tox/integration-postgres/bin/python -m pytest --profile=postgres test/rpc (exited with code 4)
___________________________________ summary ____________________________________
ERROR:   integration-postgres: commands failed
Error: Process completed with exit code 1.

I might be wrong but I don't believe that this error is related to this change?

Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

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

@laxjesse You're right, that's an unrelated error related to some dbt-rpc code we're in the process of moving around. It looks like all the actual tests passed, so we can safely ignore that error message for the time being.

This change LGTM! Thanks for the contribution :)

@jtcohen6 jtcohen6 merged commit 47033c4 into dbt-labs:develop Oct 8, 2021
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
Uses `warn_or_error` to log _or_ raise errors depending on arguments
passed.

automatic commit by git-black, original commits:
  47033c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dbt --warn-error does not error when no models are selected
2 participants