diff --git a/website/docs/reference/resource-configs/resource-path.md b/website/docs/reference/resource-configs/resource-path.md index 258b83dcd57..86b04430376 100644 --- a/website/docs/reference/resource-configs/resource-path.md +++ b/website/docs/reference/resource-configs/resource-path.md @@ -1,11 +1,28 @@ -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. +--- +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. + +```yml +resource_type: + project_name: + directory_name: + subdirectory_name: + instance_of_resource_type (by name): + ... +``` ## Example -:::info -This example is for models, but the same concepts apply for seeds and snapshots. +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 To apply a configuration to all models, do not use a ``: @@ -18,6 +35,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 +51,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 +78,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 +115,19 @@ In the following project, this would only apply to the `payments` model:    └── payments.sql ``` +### 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 3f9a19e78ca..c66f41f1cde 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",