From 687388abae86f6a9cad0fec9326176809f585d37 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:49:32 -0400 Subject: [PATCH 1/6] Adding semantic models to list --- .../migration/versions/01-upgrading-to-v1.6.md | 1 + website/docs/reference/commands/list.md | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/website/docs/guides/migration/versions/01-upgrading-to-v1.6.md b/website/docs/guides/migration/versions/01-upgrading-to-v1.6.md index bdb47bbf2ea..7cdd6df7884 100644 --- a/website/docs/guides/migration/versions/01-upgrading-to-v1.6.md +++ b/website/docs/guides/migration/versions/01-upgrading-to-v1.6.md @@ -90,4 +90,5 @@ More consistency and flexibility around packages. Resources defined in a package - [`dbt debug --connection`](/reference/commands/debug) to test just the data platform connection specified in a profile - [`dbt docs generate --empty-catalog`](/reference/commands/cmd-docs) to skip catalog population while generating docs - [`--defer-state`](/reference/node-selection/defer) enables more-granular control +- [`dbt ls`](/reference/commands/list) adds the Semantic model selection method to allow for `dbt ls -s "semantic_model:*"` and the ability to execute `dbt ls --resource-type semantic_model`. diff --git a/website/docs/reference/commands/list.md b/website/docs/reference/commands/list.md index 6084b3dec70..61e60f91333 100644 --- a/website/docs/reference/commands/list.md +++ b/website/docs/reference/commands/list.md @@ -10,7 +10,7 @@ The `dbt ls` command lists resources in your dbt project. It accepts selector ar ### Usage ``` dbt ls - [--resource-type {model,source,seed,snapshot,metric,test,exposure,analysis,default,all}] + [--resource-type {model,semantic_model,source,seed,snapshot,metric,test,exposure,analysis,default,all}] [--select SELECTION_ARG [SELECTION_ARG ...]] [--models SELECTOR [SELECTOR ...]] [--exclude SELECTOR [SELECTOR ...]] @@ -93,6 +93,16 @@ $ dbt ls --select snowplow.* --output json --output-keys name resource_type desc + + +**Listing Semantic models** + +``` +$ dbt ls -s +semantic_model:number + +``` + + **Listing file paths** ``` From d4992113bfcaa8548e8305b9d4eb393fcabcde8d Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:18:00 -0400 Subject: [PATCH 2/6] Adding to "methods" page --- website/docs/reference/node-selection/methods.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/website/docs/reference/node-selection/methods.md b/website/docs/reference/node-selection/methods.md index 2647f3416a3..18009679924 100644 --- a/website/docs/reference/node-selection/methods.md +++ b/website/docs/reference/node-selection/methods.md @@ -352,3 +352,16 @@ dbt list --select version:none # models that are *not* versioned ``` + + + +The `semantic_model` method selects [semantic models](/docs/build/semantic-models). + +```bash + +dbt ls --resource-type semantic_model # lists the semantic model resource type +dbt ls -s +semantic_model:number # lists the quantity of semantic models + +``` + + \ No newline at end of file From 8e097d7a98b978b5440f30a93c5501d2facfb71c Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:22:05 -0400 Subject: [PATCH 3/6] Update website/docs/reference/node-selection/methods.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/node-selection/methods.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/docs/reference/node-selection/methods.md b/website/docs/reference/node-selection/methods.md index 18009679924..b5ffe4b1520 100644 --- a/website/docs/reference/node-selection/methods.md +++ b/website/docs/reference/node-selection/methods.md @@ -353,6 +353,10 @@ dbt list --select version:none # models that are *not* versioned +### The "semantic_model" method + +Supported in v1.6 or newer. + The `semantic_model` method selects [semantic models](/docs/build/semantic-models). From e89dfc8a656690623838d0bc6c7bae4561e42124 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:22:18 -0400 Subject: [PATCH 4/6] Update website/docs/reference/commands/list.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/commands/list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/reference/commands/list.md b/website/docs/reference/commands/list.md index 61e60f91333..40e58178ee0 100644 --- a/website/docs/reference/commands/list.md +++ b/website/docs/reference/commands/list.md @@ -98,8 +98,8 @@ $ dbt ls --select snowplow.* --output json --output-keys name resource_type desc **Listing Semantic models** ``` -$ dbt ls -s +semantic_model:number - +# list all resources upstream of your orders semantic model +dbt ls -s +semantic_model:orders ``` From e7a472b76e27f34fc716b4456f543a93491f6957 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:22:57 -0400 Subject: [PATCH 5/6] Update website/docs/reference/node-selection/methods.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/node-selection/methods.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/docs/reference/node-selection/methods.md b/website/docs/reference/node-selection/methods.md index b5ffe4b1520..7801f29aa33 100644 --- a/website/docs/reference/node-selection/methods.md +++ b/website/docs/reference/node-selection/methods.md @@ -362,10 +362,8 @@ Supported in v1.6 or newer. The `semantic_model` method selects [semantic models](/docs/build/semantic-models). ```bash - -dbt ls --resource-type semantic_model # lists the semantic model resource type -dbt ls -s +semantic_model:number # lists the quantity of semantic models - +dbt list --select semantic_model:* # list all semantic models +dbt list --select +semantic_model:orders # list your semantic model named "orders" and all upstream resources ``` \ No newline at end of file From f116fe9cb158a5c5add8aec3e21e9ebcec6b9caa Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:20:44 -0600 Subject: [PATCH 6/6] Remove comment from code example --- website/docs/reference/commands/list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/list.md b/website/docs/reference/commands/list.md index 40e58178ee0..93a0b87dd93 100644 --- a/website/docs/reference/commands/list.md +++ b/website/docs/reference/commands/list.md @@ -97,8 +97,8 @@ $ dbt ls --select snowplow.* --output json --output-keys name resource_type desc **Listing Semantic models** +List all resources upstream of your orders semantic model: ``` -# list all resources upstream of your orders semantic model dbt ls -s +semantic_model:orders ```