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 test [--models|--exclude] config.materialized:view does not seem to work #2806

Closed
1 of 5 tasks
tpilewicz opened this issue Oct 1, 2020 · 2 comments · Fixed by #2902
Closed
1 of 5 tasks

dbt test [--models|--exclude] config.materialized:view does not seem to work #2806

tpilewicz opened this issue Oct 1, 2020 · 2 comments · Fixed by #2902
Labels
bug Something isn't working

Comments

@tpilewicz
Copy link
Contributor

tpilewicz commented Oct 1, 2020

Describe the bug

I tried to run dbt test --exclude config.materialized:view, and got the output "Nothing to do". I then tried to run dbt test --models config.materialized:view, and all tests ran. Yet dbt test --models config.materialized:table runs only 24 models.

Steps To Reproduce

In a project that has models materialized as a view and others materialized as a table / or 'incremental' ones, run dbt test --exclude config.materialized:view, or dbt test --models config.materialized:view.

Expected behavior

dbt test --exclude config.materialized:view should run all models that are not materialized as a view.

dbt test --models config.materialized:view should run only models materialized as a view.

Screenshots and log output

$ dbt test --exclude config.materialized:view
Running with dbt=0.18.0
* Deprecation Warning: dbt v0.17.0 introduces a new config format for the
dbt_project.yml file. Support for the existing version 1 format will be removed
in a future release of dbt. The following packages are currently configured with
config version 1:
 - dbt_utils
 - redshift

For upgrading instructions, consult the documentation:
  https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-0-17-0

* Deprecation Warning: The "adapter_macro" macro has been deprecated. Instead,
use the `adapter.dispatch` method to find a macro and call the result.
adapter_macro was called for: dbt_utils.type_string
Found 198 models, 295 tests, 0 snapshots, 0 analyses, 340 macros, 0 operations, 3 seed files, 0 sources
WARNING: Nothing to do. Try checking your model configs and model specification args

Then:

$ dbt test --models config.materialized:view
Running with dbt=0.18.0
* Deprecation Warning: dbt v0.17.0 introduces a new config format for the
dbt_project.yml file. Support for the existing version 1 format will be removed
in a future release of dbt. The following packages are currently configured with
config version 1:
 - dbt_utils
 - redshift

For upgrading instructions, consult the documentation:
  https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-0-17-0

* Deprecation Warning: The "adapter_macro" macro has been deprecated. Instead,
use the `adapter.dispatch` method to find a macro and call the result.
adapter_macro was called for: dbt_utils.type_string
Found 198 models, 295 tests, 0 snapshots, 0 analyses, 340 macros, 0 operations, 3 seed files, 0 sources
14:48:36 | Concurrency: 4 threads (target='staging_dev')
14:48:36 |
14:48:36 | 1 of 295 START test not_null_account_attributes_d_uuid............... [RUN]
...

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.18.0
   latest version: 0.18.0

Up to date!

Plugins:
  - bigquery: 0.18.0
  - snowflake: 0.18.0
  - redshift: 0.18.0
  - postgres: 0.18.0

The operating system you're using:
OSX

The output of python --version:
Python 3.6.8

@tpilewicz tpilewicz added bug Something isn't working triage labels Oct 1, 2020
@jtcohen6 jtcohen6 removed the triage label Oct 1, 2020
@jtcohen6
Copy link
Contributor

jtcohen6 commented Oct 1, 2020

Thanks for the bug report @tpilewicz. You're right, this does not work the way we intended. I believe it's limited to tests and config.materialized:view in particular. I have to imagine this is because view is the default materialization type, and because of the wonkier things we do around test selector expansion. I'd love to get this resolved for the next version of dbt.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Oct 28, 2020

Quick notes from discussion this afternoon:

  • Right now, tests inherit all model node.config properties. We should trim those down to only the properties that apply directly to tests. This will also trim noise from the manifest.
  • There's a larger related conversation about how test selection should work: does it make sense that dbt performs a final "jump" from its --models criteria to tests that depend on those models?

@drewbanin to weigh in with some thoughts as well

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

Successfully merging a pull request may close this issue.

2 participants