-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Snowflake warehouse in dbt_project.yml models hierarchy does not apply to tests #2981
Comments
Maybe this is a feature request instead of a bug, but it would be nice to be able to define |
Thanks for the write-up @zemekeneng! I agree, I think this would be an enhancement, and a good one at that. Currently, the only supported config for all tests is Within a data test file: {{ config(snowflake_warehouse = 'big') }}
select 1 as fun For schema tests, within
SomedayIn # for schema tests
models:
my_project:
some_models:
+tests:
snowflake_warehouse: big
# for data tests
tests:
my_project:
snowflake_warehouse: big This type of inheritance would also be necessary if you wanted to override a config/property of a test defined in an installed package. QuestionsShould a schema test take its default value of I'm inclined to say yes, though I also see a good reason in the opposite direction—that Next stepsI'm going to add this to our v0.20 milestone, since we aim for that release to improve several of the current constraints and inconsistencies around tests. |
Thanks @jtcohen6 for your thoughtful response! One comment with regard to your question:
Warehouse choice depends on a number of factors:
The 2nd and 3rd factors are especially important in organizations (like mine, Age of Learning) where the data org serves multiple (6+) independent product warehouses as well as some global data warehouses that serve and consume data from each. That said, it seems prudent to wait for tests to be a first-class config object like model/seed/snapshot to address the problem. Happy to help with this, too. I would love to contribute code and move this along! Please let me know what I can do. |
Closing in favor of #3255 + #3256, which split up the conversation we were having above. All in all, I think the implementation of #3255 in particular would be very straightforward—there's just some foundational work we need to do first, to enable test nodes to "carry" these additional configs. |
Describe the bug
Snowflake warehouse in dbt_project.yml models hierarchy does not apply to tests. While
dbt run --models XXX
runs in the custom warehouse,dbt test --models XXX
uses the warehouse specified in the profile/target.Steps To Reproduce
dbt_project.yml
~/.dbt/profiles.yml
models/my_model/model_one.sql
models/my_model/schema.yml
Expected behavior
The test should be run on
custom_warehouse
, notprofile_warehouse
.I verify that the model is run with
custom_warehouse
but the test is run onprofile_warehouse
via snowflake history.System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
Debian GNU/Linux 10 (buster)
In a docker container
The output of
python --version
:Python 3.8.5
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: