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

dbt ls should return a zero exit code when no models are selected #2886

Closed
Limess opened this issue Nov 12, 2020 · 1 comment · Fixed by #2892
Closed

dbt ls should return a zero exit code when no models are selected #2886

Limess opened this issue Nov 12, 2020 · 1 comment · Fixed by #2892
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@Limess
Copy link

Limess commented Nov 12, 2020

Describe the bug

dbt ls returns an exit code of 1 when no models are selected.

Steps To Reproduce

Run dbt ls with a model selector which returns no models, e.g. my_model,config.materialized:incremental where my_model is not incremental.

Expected behavior

I'd expect a warning message, and an exit code of 0. --warn-error could be used to opt back in to the current behaviour.

Log output

The selector 'current_concepts+,config.materialized:incremental' does not match any nodes and will be ignored
No nodes selected!

JSON (separate run):

{"timestamp": "2020-11-12T18:40:54.899662Z", "message": "No nodes selected!", "channel": "dbt", "level": 13, "levelname": "WARNING", "thread_name": "MainThread", "process": 58352, "extra": {"run_state": "internal"}}

System information

Which database are you using dbt with?
n/a

The output of dbt --version:

0.18.1

The operating system you're using:

n/a

The output of python --version:

n/a

Additional context

We're using this to programatically inspect the DBT graph and would expect an empty list rather than an error here. An error means we need to either string match against the output or ignore any errors, neither of which are desirable.

Slack thread I raised this in: https://getdbt.slack.com/archives/CJARVS0RY/p1605206141123400

@Limess Limess added bug Something isn't working triage labels Nov 12, 2020
@jtcohen6 jtcohen6 added good_first_issue Straightforward + self-contained changes, good for new contributors! and removed triage labels Nov 12, 2020
@jtcohen6
Copy link
Contributor

Agree! I don't think it makes sense for dbt ls to ever return a nonzero exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants