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

Fix incorrect error message (trivial) #3036

Merged
merged 4 commits into from
Feb 10, 2021
Merged

Conversation

ran-eh
Copy link
Contributor

@ran-eh ran-eh commented Jan 27, 2021

resolves #

Description

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 cla-bot bot added the cla:yes label Jan 27, 2021
@ran-eh ran-eh marked this pull request as ready for review January 27, 2021 21:52
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.

Thanks for the PR @ran-eh! I'm not opposed to changing this error message in the spirit of making it clearer. I am curious to hear, in what way do you feel that the current language is incorrect?

Because alert_non_existence adjudicates each of (potentially many) selection criteria, it's possible that one criterion does not match any nodes while another does. To my mind, the phrase nothing to do is a bit confusing in such a case:

$ dbt run -m fct_sprints asdfgh
...
The selector 'asdfgh' does not match any nodes - nothing to do

14:21:31 | Concurrency: 8 threads (target='dev')
14:21:31 |
14:21:31 | 1 of 1 START table model dbt_jcohen.fct_sprints...................... [RUN]

Perhaps we could simplify this message to just: The selection criterion 'asdfgh' does not match any nodes. (While we're here, we may as well disambiguate from YAML selectors / --selector, too.)

@ran-eh
Copy link
Contributor Author

ran-eh commented Jan 28, 2021

Thanks for the PR @ran-eh! I'm not opposed to changing this error message in the spirit of making it clearer. I am curious to hear, in what way do you feel that the current language is incorrect?

Because alert_non_existence adjudicates each of (potentially many) selection criteria, it's possible that one criterion does not match any nodes while another does. To my mind, the phrase nothing to do is a bit confusing in such a case:

$ dbt run -m fct_sprints asdfgh
...
The selector 'asdfgh' does not match any nodes - nothing to do

14:21:31 | Concurrency: 8 threads (target='dev')
14:21:31 |
14:21:31 | 1 of 1 START table model dbt_jcohen.fct_sprints...................... [RUN]

Perhaps we could simplify this message to just: The selection criterion 'asdfgh' does not match any nodes. (While we're here, we may as well disambiguate from YAML selectors / --selector, too.)

Agreed and changed.

@jtcohen6 jtcohen6 changed the base branch from dev/margaret-mead to develop February 8, 2021 11:26
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.

Thanks for this @ran-eh!

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.

Whoops, sorry for the over-eager approval. One tiny change and then this should be fit to ship.

core/dbt/graph/selector.py Outdated Show resolved Hide resolved
Co-authored-by: Jeremy Cohen <[email protected]>
@jtcohen6 jtcohen6 merged commit c8f0469 into dbt-labs:develop Feb 10, 2021
@jtcohen6 jtcohen6 deleted the patch-2 branch February 10, 2021 11:00
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.

2 participants