-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dbt --warn-error
does not error when no models are selected
#4006
Comments
@laxjesse Thanks for the issue! I'll share a bit more of my thought process below; to make a long story short, this is a quite simple change. This line: Should instead use warn_or_error("\nWARNING: Nothing to do. Try checking your model "
"configs and model specification args") (You'll need to add We should also make the equivalent change for the Following the comment in #2886:
Would you be interested in contributing those quick fixes? :) Bigger question: Does it make sense for this to return a warning, or should it be info only? Reasons I'm asking:
I'm raising those in case you have thoughts there. When I look back at the history of the
We only missed this warning message because, at the time of that PR, it was Basically, we should never use |
@jtcohen6 thanks for the info! I think I can try and make these changes
to speak to my specific use case, my intention was to use conversely, your CI example does seem like a reasonable situation where you'd want the opposite behavior I'd still say that yes this should error bc
|
For anyone else stumbling on this issue through search, you can include the following config if you don't want to error when no models are selected, but do want to be strict on other warnings in CI:
|
Describe the bug
running
dbt --warn-error run
with selection syntax that selects no models returns a warning and not an error.Steps To Reproduce
tried with a number of different selection syntax as well, such as
(example.sql a table)
both commands warn that there is nothing to do, but return exit status 0
Expected behavior
I would expect an error instead of a warning.
Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:Tested on version 0.21.0 as well ^
The operating system you're using:
Mac OS Big Sur
The output of
python --version
:Python 3.6.8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: