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

feat(dbt): implement subsetting to execute dbt tests #16801

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

rexledesma
Copy link
Contributor

Summary & Motivation

Add the ability to select individual dbt tests when subsetting the execution of a dbt project.

Now that users can explicitly select for both tests and models, we should disable dbt's indirect selection: https://docs.getdbt.com/reference/node-selection/test-selection-examples?indirect-selection-mode=empty#indirect-selection.

dbt's indirect selection basically controls whether tests are automatically run when a dbt model is built. Previously, in the case for dbt build, all tests associated with a dbt model would be run if the model is materialized. Now, we only run the tests that were explicitly selected and are available in the asset definition's context.

How I Tested These Changes

local, pytest

@rexledesma
Copy link
Contributor Author

rexledesma commented Sep 26, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@rexledesma rexledesma force-pushed the rl/model-dbt-tests-on-attached-node branch from 83b5e63 to 228070a Compare September 26, 2023 22:08
@rexledesma rexledesma force-pushed the rl/model-dbt-tests-on-attached-node branch from 228070a to 7674850 Compare September 27, 2023 01:54
Base automatically changed from rl/model-dbt-tests-on-attached-node to master September 27, 2023 02:22
@rexledesma rexledesma marked this pull request as ready for review September 27, 2023 02:39
@rexledesma rexledesma force-pushed the rl/dbt-subsetting branch 2 times, most recently from 1d7128c to d2ddd84 Compare September 27, 2023 03:57
@sryza sryza requested a review from OwenKephart September 27, 2023 17:43
@rexledesma rexledesma changed the base branch from master to rl/assert-any-all-asset-check-metadata September 27, 2023 19:41
@rexledesma rexledesma force-pushed the rl/dbt-subsetting branch 2 times, most recently from 3d29758 to a0a3113 Compare September 27, 2023 19:45
@rexledesma rexledesma removed the request for review from erinkcochran87 September 27, 2023 19:45
@github-actions
Copy link

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-c7wspd4b0-elementl.vercel.app
https://rl-dbt-subsetting.dagster.dagster-docs.io

Direct link to changed pages:

@rexledesma rexledesma force-pushed the rl/assert-any-all-asset-check-metadata branch from 885c787 to 625e26d Compare September 27, 2023 19:55
@rexledesma rexledesma force-pushed the rl/assert-any-all-asset-check-metadata branch from 625e26d to 0e0819d Compare September 27, 2023 20:17
@rexledesma rexledesma force-pushed the rl/assert-any-all-asset-check-metadata branch from 0e0819d to d13e120 Compare September 27, 2023 20:30
@rexledesma rexledesma changed the base branch from rl/assert-any-all-asset-check-metadata to master October 3, 2023 15:07
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-ogayjscmz-elementl.vercel.app
https://rl-dbt-subsetting.core-storybook.dagster-docs.io

Built with commit f6af804.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-pu6k6twa6-elementl.vercel.app
https://rl-dbt-subsetting.components-storybook.dagster-docs.io

Built with commit f6af804.
This pull request is being automatically deployed with vercel-action

@rexledesma rexledesma merged commit 56994a4 into master Oct 3, 2023
@rexledesma rexledesma deleted the rl/dbt-subsetting branch October 3, 2023 17:35
yuhan pushed a commit that referenced this pull request Oct 3, 2023
## Summary & Motivation
Add the ability to select individual dbt tests when subsetting the
execution of a dbt project.

Now that users can explicitly select for both tests and models, we
should disable dbt's indirect selection:
https://docs.getdbt.com/reference/node-selection/test-selection-examples?indirect-selection-mode=empty#indirect-selection.

dbt's indirect selection basically controls whether tests are
automatically run when a dbt model is built. Previously, in the case for
`dbt build`, all tests associated with a dbt model would be run if the
model is materialized. Now, we only run the tests that were explicitly
selected and are available in the asset definition's context.

## How I Tested These Changes
local, pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants