From 90d2af86210166ee5c2602d826aa942f7aa45781 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 3 Nov 2023 14:27:46 +0000 Subject: [PATCH 1/5] updates to pages --- .../resource-configs/resource-path.md | 37 +++++++++++++++++-- website/docs/reference/source-configs.md | 19 +++++++++- website/sidebars.js | 1 + 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index 258b83dcd57..c99b131769e 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -1,11 +1,21 @@ -The `` nomenclature is used in this documentation when documenting how to configure a model, seed, or snapshot, from your `dbt_project.yml` file. It represents the nested dictionary keys that provide the path to either a directory of models, or a single model. +The `` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. + +It represents the nested dictionary keys that provide the path to a directory of that resource type, or a single instance of that resource type by name. + +```yml +: + : + : + : + : + ... +``` ## Example -:::info -This example is for models, but the same concepts apply for seeds and snapshots. +The following examples are for models, but the same concepts apply for seeds, snapshots, tests, sources, and other resource types. -::: +### Apply config to all models To apply a configuration to all models, do not use a ``: @@ -18,6 +28,8 @@ models: +### Apply config to all models in your project + To apply a configuration to all models in _your_ project only, use your [project name](/reference/project-configs/name) as the ``: @@ -32,6 +44,8 @@ models: +### Apply config to all models in a subdirectory + To apply a configuration to all models in a subdirectory of your project, e.g. `staging`, nest the directory under the project name: @@ -57,6 +71,8 @@ In the following project, this would apply to models in the `staging/` directory ``` +### Apply config to all models in one model + To apply a configuration to one model, nest the full path under the project name. For a model at `/staging/stripe/payments.sql`, this would look like: @@ -92,3 +108,16 @@ In the following project, this would only apply to the `payments` model:    └── payments.sql ``` +**Note**: To disable a source nested in a YAML file in a subfolder, you will need to supply the path to that YAML file, as well as the source name in the `dbt_project.yml` file. For example: + + + +```yaml +sources: + your_project_name: + subdirectory_name: + source_yaml_file_name: + source_name: + +enabled: false # This will apply to sources nested in subfolders. +``` + diff --git a/website/docs/reference/source-configs.md b/website/docs/reference/source-configs.md index 3f9a19e78ca..973c7e357cd 100644 --- a/website/docs/reference/source-configs.md +++ b/website/docs/reference/source-configs.md @@ -61,7 +61,24 @@ sources: ## Configuring sources -Sources can be configured via a `config:` block within their `.yml` definitions, or from the `dbt_project.yml` file under the `sources:` key. This configuration is most useful for configuring sources imported from [a package](/docs/build/packages). You can disable sources imported from a package to prevent them from rendering in the documentation, or to prevent [source freshness checks](/docs/build/sources#snapshotting-source-data-freshness) from running on source tables imported from packages. +Sources can be configured via a `config:` block within their `.yml` definitions, or from the `dbt_project.yml` file under the `sources:` key. This configuration is most useful for configuring sources imported from [a package](/docs/build/packages). + +You can disable sources imported from a package to prevent them from rendering in the documentation, or to prevent [source freshness checks](/docs/build/sources#snapshotting-source-data-freshness) from running on source tables imported from packages. + +- **Note**: To disable a source nested in a YAML file in a subfolder, you will need to supply the path to that YAML file plus the source name in the dbt_project.yml file. For example: + + + +```yml +sources: + your_project_name: + subdirectory_name: + source_yaml_file_name: + source_name: + +enabled: false # This will apply to sources nested in subfolders. +``` + + ### Examples diff --git a/website/sidebars.js b/website/sidebars.js index 055dfed0e7d..8920a7180d4 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -716,6 +716,7 @@ const sidebarSettings = { label: "Resource configs and properties", items: [ "reference/configs-and-properties", + "reference/resource-configs/resource-path", { type: "category", label: "General properties", From ef1e1f735ac3a299492f485e946218a552a3b422 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 3 Nov 2023 14:41:17 +0000 Subject: [PATCH 2/5] tweak --- .../resource-configs/resource-path.md | 38 ++++++++++++------- website/docs/reference/source-configs.md | 22 +++++------ 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index c99b131769e..c1b119779d2 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -1,3 +1,10 @@ +--- +title: Resource path +description: "Learn how to use resource paths to configure resource types in dbt." +id: resource-path +sidebar_label: "About resource paths" +--- + The `` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. It represents the nested dictionary keys that provide the path to a directory of that resource type, or a single instance of that resource type by name. @@ -13,7 +20,7 @@ It represents the nested dictionary keys that provide the path to a directory of ## Example -The following examples are for models, but the same concepts apply for seeds, snapshots, tests, sources, and other resource types. +The following examples are mostly for models and a source, but the same concepts apply for seeds, snapshots, tests, sources, and other resource types. ### Apply config to all models @@ -108,16 +115,19 @@ In the following project, this would only apply to the `payments` model:    └── payments.sql ``` -**Note**: To disable a source nested in a YAML file in a subfolder, you will need to supply the path to that YAML file, as well as the source name in the `dbt_project.yml` file. For example: - - - -```yaml -sources: - your_project_name: - subdirectory_name: - source_yaml_file_name: - source_name: - +enabled: false # This will apply to sources nested in subfolders. -``` - +### Apply config source nested in a subfolder + +To disable a source nested in a YAML file in a subfolder, you will need to supply the path to that YAML file, as well as the source name in the `dbt_project.yml` file.

+ The following example shows how to disable a source nested in a YAML file in a subfolder: + + + + ```yaml + sources: + your_project_name: + subdirectory_name: + source_yaml_file_name: + source_name: + +enabled: false # This will apply to sources nested in subfolders. + ``` + diff --git a/website/docs/reference/source-configs.md b/website/docs/reference/source-configs.md index 973c7e357cd..c66f41f1cde 100644 --- a/website/docs/reference/source-configs.md +++ b/website/docs/reference/source-configs.md @@ -67,17 +67,17 @@ You can disable sources imported from a package to prevent them from rendering i - **Note**: To disable a source nested in a YAML file in a subfolder, you will need to supply the path to that YAML file plus the source name in the dbt_project.yml file. For example: - - -```yml -sources: - your_project_name: - subdirectory_name: - source_yaml_file_name: - source_name: - +enabled: false # This will apply to sources nested in subfolders. -``` - + + + ```yml + sources: + your_project_name: + subdirectory_name: + source_yaml_file_name: + source_name: + +enabled: false # This will apply to sources nested in subfolders. + ``` + From 1fcb8a9e9a9e32cd712659919198913b70a79000 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:02:57 +0000 Subject: [PATCH 3/5] Update resource-path.md --- .../docs/reference/resource-configs/resource-path.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index c1b119779d2..86b04430376 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -10,11 +10,11 @@ The `` nomenclature is used in this documentation when documentin It represents the nested dictionary keys that provide the path to a directory of that resource type, or a single instance of that resource type by name. ```yml -: - : - : - : - : +resource_type: + project_name: + directory_name: + subdirectory_name: + instance_of_resource_type (by name): ... ``` From 85e5e4118b2855abfe3289fcbe07d13e44b22663 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:03:29 +0000 Subject: [PATCH 4/5] Update website/docs/reference/resource-configs/resource-path.md --- website/docs/reference/resource-configs/resource-path.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index 86b04430376..8a59a1032e9 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -5,7 +5,7 @@ id: resource-path sidebar_label: "About resource paths" --- -The `` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. +The `resource-path` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. It represents the nested dictionary keys that provide the path to a directory of that resource type, or a single instance of that resource type by name. From 205f5346e0482f91c72ddc8f352bc4f419b5e774 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:04:42 +0000 Subject: [PATCH 5/5] Update website/docs/reference/resource-configs/resource-path.md --- website/docs/reference/resource-configs/resource-path.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index 8a59a1032e9..86b04430376 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -5,7 +5,7 @@ id: resource-path sidebar_label: "About resource paths" --- -The `resource-path` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. +The `` nomenclature is used in this documentation when documenting how to configure resource types like models, seeds, snapshots, tests, sources, and others, from your `dbt_project.yml` file. It represents the nested dictionary keys that provide the path to a directory of that resource type, or a single instance of that resource type by name.