From ce39d1f727acaa16622d2471077dfd7c98f3e412 Mon Sep 17 00:00:00 2001 From: Natalie Fiann Date: Tue, 24 Sep 2024 14:04:28 +0100 Subject: [PATCH 01/10] dbt test now enables passing values --- .../reference/global-configs/resource-type.md | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index ad8897a745c..afb640de98d 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -42,7 +42,7 @@ The available resource types are: - + - [`analysis`](/docs/build/analyses) - [`exposure`](/docs/build/exposures) @@ -58,6 +58,47 @@ The available resource types are: + + +- [`analysis`](/docs/build/analyses) +- [`exposure`](/docs/build/exposures) +- [`metric`](/docs/build/build-metrics-intro) +- [`model`](/docs/build/models) +- [`saved_query`](/docs/build/saved-queries) +- [`seed`](/docs/build/seeds) +- [`semantic_model`](/docs/build/semantic-models) +- [`snapshot`](/docs/build/snapshots) +- [`source`](/docs/build/sources) +- [`test`](/docs/build/data-tests) +- [`unit_test`](/docs/build/unit-tests) + +dbt `test` now enables passing values such as `unit_tests`, `tests` and more so in the `--resource-type` and `--exclude-resource-type` for CLI flags (or in the environment variables `DBT_RESOURCE_TYPES` and `DBT_EXCLUDE_RESOURCE_TYPES)`. + +Here are some examples of how dbt `test` enables passing values: + + + +``` +dbt `test` --resource-type unit_test +dbt `test` --exclude-resource-type unit_test + +``` + + + + + +``` + +`DBT_RESOURCE_TYPES`=`unit_test` dbt `test` +`DBT_EXCLUDE_RESOURCE_TYPES`=`unit_test` dbt `test` + +``` + + + + + ## 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. From 12e1587ad47ffcec4393b4ffff4bb98876bbeb00 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:52:41 +0100 Subject: [PATCH 02/10] Update website/docs/reference/global-configs/resource-type.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index afb640de98d..ae5ea2c5330 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -42,7 +42,7 @@ The available resource types are: - + - [`analysis`](/docs/build/analyses) - [`exposure`](/docs/build/exposures) From cc335cce9c0918a7015f2304acba07965fe84b02 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:53:23 +0100 Subject: [PATCH 03/10] Update website/docs/reference/global-configs/resource-type.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index ae5ea2c5330..98a7405950b 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -72,7 +72,7 @@ The available resource types are: - [`test`](/docs/build/data-tests) - [`unit_test`](/docs/build/unit-tests) -dbt `test` now enables passing values such as `unit_tests`, `tests` and more so in the `--resource-type` and `--exclude-resource-type` for CLI flags (or in the environment variables `DBT_RESOURCE_TYPES` and `DBT_EXCLUDE_RESOURCE_TYPES)`. +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)`. Here are some examples of how dbt `test` enables passing values: From 7f9bebf2d3b09e0dcaa1d2c1a4005186e0460971 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:53:31 +0100 Subject: [PATCH 04/10] Update website/docs/reference/global-configs/resource-type.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index 98a7405950b..5242e969dff 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -74,7 +74,7 @@ The available resource types are: 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)`. -Here are some examples of how dbt `test` enables passing values: +The following are some examples of how dbt `test` enables passing values: From 5b1a6b6980d5e1d77d23b07f218516a563d2219d Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:19:47 -0600 Subject: [PATCH 05/10] Added to the `dbt test` subcommand starting in v1.9 --- website/docs/reference/global-configs/resource-type.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index 5242e969dff..8c314b14669 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -4,8 +4,18 @@ id: "resource-type" sidebar: "resource type" --- + + 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 test`, `dbt clone`, and `dbt list` commands. + + + This means the flags enable you to specify which types of resources to include or exclude when running the commands, instead of targeting specific resources. :::tip Note From 2d29514f2d8ca63adca69563d1f283abc820d6af Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:26:39 -0600 Subject: [PATCH 06/10] Examples of `--resource-type` / `--exclude-resource-type` with `dbt test` --- .../reference/global-configs/resource-type.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index 8c314b14669..453ae74d134 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -160,3 +160,27 @@ Instead of targeting specific resources, use the `--resource-flag` or `--exclude + + + +- In this example, use the following command to exclude _all_ unit tests when running tests. Note that the `--exclude-resource-type` flag is only available in dbt version 1.8 and higher: + + + + ```text + dbt test --exclude-resource-type unit_test + ``` + + + +- In this example, use the following command to include all data tests when running tests: + + + + ```text + dbt test --resource-type test + ``` + + + + From c3591be639346974803e45c3d55a285c80ba4ccd Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:32:10 -0600 Subject: [PATCH 07/10] Remove in favor of the new examples added below --- .../reference/global-configs/resource-type.md | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index 453ae74d134..14bc14364bd 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -68,47 +68,6 @@ The available resource types are: - - -- [`analysis`](/docs/build/analyses) -- [`exposure`](/docs/build/exposures) -- [`metric`](/docs/build/build-metrics-intro) -- [`model`](/docs/build/models) -- [`saved_query`](/docs/build/saved-queries) -- [`seed`](/docs/build/seeds) -- [`semantic_model`](/docs/build/semantic-models) -- [`snapshot`](/docs/build/snapshots) -- [`source`](/docs/build/sources) -- [`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)`. - -The following are some examples of how dbt `test` enables passing values: - - - -``` -dbt `test` --resource-type unit_test -dbt `test` --exclude-resource-type unit_test - -``` - - - - - -``` - -`DBT_RESOURCE_TYPES`=`unit_test` dbt `test` -`DBT_EXCLUDE_RESOURCE_TYPES`=`unit_test` dbt `test` - -``` - - - - - ## 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. From 42efcf8815f385241b11acd964b21d5ddf8436be Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:33:47 -0600 Subject: [PATCH 08/10] List of applicable resources remains the same between v1.8 and v1.9 --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index 14bc14364bd..f0b36c724ec 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -52,7 +52,7 @@ The available resource types are: - + - [`analysis`](/docs/build/analyses) - [`exposure`](/docs/build/exposures) From 18d67caa46b011612bb2f96f2319931a0f7af166 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:51:36 -0600 Subject: [PATCH 09/10] Remove the version-specific call-out (which had the wrong version anyways) --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index f0b36c724ec..c75df5b8e2c 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -122,7 +122,7 @@ Instead of targeting specific resources, use the `--resource-flag` or `--exclude -- In this example, use the following command to exclude _all_ unit tests when running tests. Note that the `--exclude-resource-type` flag is only available in dbt version 1.8 and higher: +- In this example, use the following command to exclude _all_ unit tests when running tests: From 33bf98fa5b1392750c77197b76bdbccc973d4d06 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:35:23 -0600 Subject: [PATCH 10/10] In Versionless and from dbt v1.9 onwards, these flags are also supported in the `dbt test` command Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/global-configs/resource-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/resource-type.md b/website/docs/reference/global-configs/resource-type.md index c75df5b8e2c..9e6ec82df06 100644 --- a/website/docs/reference/global-configs/resource-type.md +++ b/website/docs/reference/global-configs/resource-type.md @@ -6,7 +6,7 @@ sidebar: "resource type" -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. In Versionless and from dbt v1.9 onwards, these flags are also supported in the `dbt test` command.