-
Notifications
You must be signed in to change notification settings - Fork 977
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
supports --resource-type
/ --exclude-resource-type
CLI flags and related environment variables
#6126
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening. I think we can take a simpler approach to the docs changes here. We already have an "Example" section on this page. We should just expand that to mention you can also use this with the dbt test
command (instead of just dbt build
). Maybe we have examples of using this with both dbt build
and dbt test
in that section.
- [`test`](/docs/build/data-tests) | ||
- [`unit_test`](/docs/build/unit-tests) | ||
|
||
dbt `test` now enables passing values such as `unit_tests`, `tests`, and more in the `--resource-type` and `--exclude-resource-type` for CLI flags (or in the environment variables `DBT_RESOURCE_TYPES` and `DBT_EXCLUDE_RESOURCE_TYPES)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need callouts like "now" - we should:
- have a callout that this is available in versionless and starting in dbt Core
v1.9
- then document the feature
</Expandable> | ||
|
||
</VersionBlock> | ||
|
||
## Example | ||
|
||
Instead of targeting specific resources, use the `--resource-flag` or `--exclude-resource-type` flags to target all resources of a certain type: `dbt build --resource-type RESOURCE_TYPE` replacing `RESOURCE_TYPE` with the resource type you want to include. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of targeting specific resources, use the `--resource-flag` or `--exclude-resource-type` flags to target all resources of a certain type: `dbt build --resource-type RESOURCE_TYPE` replacing `RESOURCE_TYPE` with the resource type you want to include. | |
Instead of targeting specific resources, use the `--resource-flag` or `--exclude-resource-type` flags with the `build` or `test` command to target all resources of a certain type: `dbt build --resource-type RESOURCE_TYPE` replacing `RESOURCE_TYPE` with the resource type you want to include. |
I think this is all we need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/dbt-labs/docs.getdbt.com/pull/6126/files#r1782100963 which I believe accomplishes this same thing.
--resource-type
and --exclude-resource-type
(CLI flags and env vars) with dbt test
command
--resource-type
and --exclude-resource-type
(CLI flags and env vars) with dbt test
commanddbt test
supports --resource-type
/ --exclude-resource-type
CLI flags and related environment variables
|
||
<VersionBlock firstVersion="1.9"> | ||
|
||
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt test`, `dbt clone`, and `dbt list` commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this resolves the comment in #6126 (comment).
Namely, as-of v1.9, there are 4 different subcommands that support these flags, and this sentence lists all of them: build
, test
, clone
, and list
.
@@ -4,8 +4,18 @@ id: "resource-type" | |||
sidebar: "resource type" | |||
--- | |||
|
|||
<VersionBlock lastVersion="1.8"> | |||
|
|||
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non blocker but thought it might be helpful for 1.8 and lower users to know that newer versions/versionless supports dbt test
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands. | |
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands. Starting in Versionless and dbt v1.9, these flags are also supported in the `dbt test` command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Closed off as Core project has been paused |
reopening bc i believe @dbeatty10 is repurposing this pr to make the necessary updates for v1.9 |
Moved to #6192 |
… flags and related environment variables (#6192) [Preview](https://docs-getdbt-com-git-dbeatty-6101-docs-dbt-labs.vercel.app/reference/global-configs/resource-type) Resolves #6101 Originally #6126 ## What are you changing in this pull request and why? Beginning in dbt-core v1.9, it is possible to use the `--resource-type` and `--exclude-resource-type` CLI flags (and related env vars) with the `dbt test` command. ## Checklist - [x] I have reviewed the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and/or [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content) guidelines. - [x] Add a note to the prerelease version [Migration Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade) --------- Co-authored-by: Natalie Fiann <Natalie.Fiann@dbtlabs.com> Co-authored-by: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Preview
Resolves #6101
What are you changing in this pull request and why?
Beginning in dbt-core v1.9, it is possible to use the
--resource-type
and--exclude-resource-type
CLI flags (and related env vars) with thedbt test
command.Checklist