-
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
Net-new test configs #3258
Comments
Not sure if this issue is the right place for this but @jtcohen6 what do you think of supporting With high-volume date-partitioned tables (especially for web traffic data), we often want to be able to test only the most recent partition each time. Testing the entire table each time would be too expensive and adding a models:
- name: some_table
test_where: "date_col = date_sub(current_date, interval 1 day)"
columns:
... |
@prratek Such a good thought. I was also thinking about this in light of whether, for models with the I'm thinking about this in a few ways:
Today, it's be possible to define an ephemeral model that wraps In v0.20.0, it will be possible to define test configs in tests:
my_project:
schema_test:
exact_name_of_schema_test:
+where: "date_col = date_sub(current_date, interval 1 day)"
exact_name_of_other_schema_test:
+where: "date_col = date_sub(current_date, interval 1 day)" We could improve test FQNs (#3259) so that they include the name and path of the model they're defined on, allowing them to instead work like: tests:
my_project:
subdirectory:
some_table:
+where: "date_col = date_sub(current_date, interval 1 day)" Finally, in a post-#2401 world (reconciliation of node configs and resource properties), we may be able to get quite close to the proposal you make above. I'm interested in tests being able to "inherit" configs from the parent models they're defined on (#3256), so that you could define a |
This all sounds really great, particularly the improvements to test FQNs and what that enables! My only thought re: potentially inheriting this from model config is that the |
Describe the feature
Let's add configs for:
where
limit
warn_if
,error_if
(picking up from Threshold argument for Test Severity #2219 + Expect Failure Mode for Tests #2982)Following the work in #3257, these will be configurable from
config()
+dbt_project.yml
+.yml
instantiation (for generic tests).Mechanism
Add to TestConfig:
https://github.com/fishtown-analytics/dbt/blob/7203123d56e42007d569a03c76bea0f351fb1611/core/dbt/contracts/graph/model_config.py#L437-L440
Add to schema test builder (along with methods lower down):
https://github.com/fishtown-analytics/dbt/blob/7203123d56e42007d569a03c76bea0f351fb1611/core/dbt/parser/schema_test_builders.py#L187-L188
Add to shortcut method for "fast" schema tests:
https://github.com/fishtown-analytics/dbt/blob/7203123d56e42007d569a03c76bea0f351fb1611/core/dbt/parser/schemas.py#L490-L491
The text was updated successfully, but these errors were encountered: