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

[Bug] WARN_ERROR_OPTIONS with include all and exclude specific warning not working as expected #10010

Closed
2 tasks done
jeremyyeo opened this issue Apr 23, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@jeremyyeo
Copy link
Contributor

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

According to the docs, it is possible to:

When include is set to "all" or "*", the optional exclude parameter can be set to exclude specifc warnings from being treated as exceptions.

And indeed seems the case as well in Michelle's checklist for --warn-error-options:

❯ dbt --warn-error-options '{"include": "all"}' run -m nada
20:32:56  Running with dbt=1.4.0-b1
20:32:57  Found 5 models, 20 tests, 0 snapshots, 0 analyses, 303 macros, 0 operations, 3 seed files, 0 sources, 1 exposure, 0 metrics
20:32:57  Encountered an error:
Compilation Error
  The selection criterion 'nada' does not match any nodes

❯ dbt --warn-error-options '{"include": "all", "exclude": [NoNodesForSelectionCriteria,NothingToDo]}' run -m nada
20:36:53  Running with dbt=1.4.0-b1
20:36:53  Found 5 models, 20 tests, 0 snapshots, 0 analyses, 303 macros, 0 operations, 3 seed files, 0 sources, 1 exposure, 0 metrics
20:36:53  The selection criterion 'nada' does not match any nodes
20:36:53  
20:36:53  Nothing to do. Try checking your model configs and model specification args

❯ dbt --warn-error-options '{"include": [NoNodesForSelectionCriteria]}' run -m nada
20:37:21  Running with dbt=1.4.0-b1
20:37:22  Found 5 models, 20 tests, 0 snapshots, 0 analyses, 303 macros, 0 operations, 3 seed files, 0 sources, 1 exposure, 0 metrics
20:37:22  Encountered an error:
Compilation Error
  The selection criterion 'nada' does not match any nodes

This doesn't seem to be the case as of this writing.

Expected Behavior

Should be as per docs.

Steps To Reproduce

Pretty straight forward really:

(venv_dbt_1.7.latest) ➜  dbt-basic git:(main) ✗ dbt --warn-error-options '{"include": "all", "exclude": ["NoNodesForSelectionCriteria"]}' run -s nada && echo 'printed if no error'
00:17:03  Running with dbt=1.7.13
00:17:03  Registered adapter: postgres=1.7.13
00:17:04  Found 2 models, 1 operation, 0 sources, 0 exposures, 0 metrics, 403 macros, 0 groups, 0 semantic models
00:17:04  The selection criterion 'nada' does not match any nodes
00:17:04  
00:17:04  Encountered an error:
Compilation Error
  Nothing to do. Try checking your model configs and model specification args

(venv_dbt_1.7.latest) ➜  dbt-basic git:(main) ✗ dbt run -s nada && echo 'printed if no error'
00:17:32  Running with dbt=1.7.13
00:17:32  Registered adapter: postgres=1.7.13
00:17:33  Found 2 models, 1 operation, 0 sources, 0 exposures, 0 metrics, 403 macros, 0 groups, 0 semantic models
00:17:33  The selection criterion 'nada' does not match any nodes
00:17:33  
00:17:33  Nothing to do. Try checking your model configs and model specification args
printed if no error

Relevant log output

No response

Environment

- OS: macOS
- Python: 3.11.2
- dbt:
Core:
  - installed: 1.7.13
  - latest:    1.7.13 - Up to date!
Plugins:
  - postgres:   1.7.13 - Up to date!

Which database adapter are you using with dbt?

postgres

Additional Context

I tested couple versions - even back to dbt-core==1.4.0 but seems like we have been not following the spec for a while now?

@jeremyyeo jeremyyeo added bug Something isn't working triage labels Apr 23, 2024
@jeremyyeo
Copy link
Contributor Author

My bad - wasn't excluding NothingToDo :)

@dbeatty10 dbeatty10 removed the triage label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants