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

Can't filter out dbt tests of BigQuery tables by a selector with config.materialized:view #2899

Closed
1 of 5 tasks
yu-iskw opened this issue Nov 19, 2020 · 3 comments
Closed
1 of 5 tasks
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@yu-iskw
Copy link
Contributor

yu-iskw commented Nov 19, 2020

Describe the bug

We are not able to filter out dbt tests of BigQuery tables by a selector with config.materialized:view.

I implemented a dbt model for a BigQuery table and its schema tests.
When I wanted to execute only schema tests of BigQuery views by a selector, I found the issue that filtering out by a selector didn't work as expected.
In my case, I didn't want to run any schema test of BigQuery tables with a selector which has config.materialized:view.
Even I simplified the condition with just config.materialized:view, I made sure it didn't work as expected.

Steps To Reproduce

UPDATE
I created a branch/PR in my forked repository.
https://github.com/yu-iskw/jaffle_shop/pull/1

In as much detail as possible, please provide steps to reproduce the issue. Sample data that triggers the issue, example model code, etc is all very helpful here.

  1. Create a model for a table (of BigQuery). The materialization have to be declared in .sql file with {{ config() }}.
  2. Implement schema tests of the model
  3. Add a selector with config.materialized:view
  4. Run dbt ls --selector view --resource test
selectors:
  - name: view
    definition:
      'config.materialized:view'

Expected behavior

When I executed dbt ls --models "config.materialized:view", the schema tests of BigQuery tables didn't appear.
That was what I expected for the behavior of selectors.

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

Which database are you using dbt with?

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

The output of dbt --version:

$ dbt --version
installed version: 0.18.1
   latest version: 0.18.1

Up to date!

Plugins:
  - bigquery: 0.18.1
  - snowflake: 0.18.1
  - redshift: 0.18.1
  - postgres: 0.18.1

The operating system you're using:
I saw the error on the two environments.

  • Mac OS (locally)
  • Docker image: google/cloud-sdk:317.0.0 (Production)

The output of python --version:

Python 3.7.7

Additional context

Add any other context about the problem here.

@yu-iskw yu-iskw added bug Something isn't working triage labels Nov 19, 2020
@rsella
Copy link
Contributor

rsella commented Nov 19, 2020

As noted on Slack , possibly related to #2806

@jtcohen6 jtcohen6 added duplicate This issue or pull request already exists and removed triage labels Nov 19, 2020
@jtcohen6
Copy link
Contributor

Today, tests technically have the config materialized: view (i.e. the default value), which makes the config.materialized selection method work in a way that's surprising for dbt test. This is definitely something we want to fix.

Closing only because it's a duplicate of #2806.

@yu-iskw
Copy link
Contributor Author

yu-iskw commented Nov 19, 2020

@rsella @jtcohen6 Thank you for guiding me. I keep tracking #2806 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants