Skip to content

Commit

Permalink
add page
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Nov 14, 2023
1 parent 62f130a commit 4f24c81
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
68 changes: 68 additions & 0 deletions website/docs/reference/about-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: "About resource types"
id: "about-resources"
description: "Learn about the different resource types in dbt, their supported properties and configurations, and how to use them."
sidebar_label: "About resource types"
---

dbt supports different types of resource types. Each one has a set of supported [properties and configurations](/reference/configs-and-properties) within a dbt project, which are key to how they function and integrate within your data project.

## Resource types table

The following tables describes each resource type, its identifier, and a brief description of its purpose.

WHERE DO WE LINK TO FOR EACH RESOURCE TYPE? CONTENT UNDER DOCS? OR UNDER RESOURCE CONFIGS?

| Resource type | Identifier | Description |
|-------------------|--------------------|-------------|
| Analysis | `analysis` | Similar to models, but usually used for exploratory data analysis and not directly integrated into the dbt DAG (Directed Acyclic Graph). |
| Documentation | `doc` | Used for documenting the project, including descriptions of models, columns, and more. |
| Exposure | `exposure` | Document downstream use of dbt models in dashboards, reports, or analysis. |
| Group | `group` | Used for grouping and organizing other dbt resources, potentially for managing permissions or categorization. |
| Macro | `macro` | Reusable code snippets in Jinja, allowing for custom logic and SQL reuse. |
| Metric | `metric` | Define business metrics using a standardized syntax, which can be used across models and analyses. |
| Model | `model` | Central to dbt projects, models are SQL files that define transformations and datasets. These are typically the primary analytical outputs. |
| Operation | `operation` | Custom operations that can be run from the dbt command line, often for administrative or maintenance tasks. |
| RPC Call | `rpc` | Deprecated in dbt v1.6. Run a`rpc` to execute dbt commands over a network. Deprecated in dbt v1.6. |
| Saved Query | `saved_query` | Represent saved SQL queries, potentially for reuse or tracking purposes. |
| Seed | `seed` | CSV files that are loaded into the database as static tables, useful for small reference data. |
| Semantic model | `semantic_model` | A higher-level abstraction of data models, focusing on the semantic layer or business logic representation. |
| Snapshot | `snapshot` | Capture data at a specific point in time to track changes, useful for historical reporting and auditing. |
| Source | `source` | Represents raw data sources, helping to define and document the initial state of data that dbt interacts with. |
| SQL operation | `sql_operation` | Custom SQL operations that can be executed within dbt workflows. |
| Test | `test` | Define tests to ensure data quality and integrity, such as uniqueness, not-null constraints, and custom data validation. |

## Supported properties and configs table

Resources, such as models, snapshots, seeds, tests, and so on, are the backbone of your data project. Each resource can have defined properties and configurations, which are key to how they function and integrate within your project and pipeline.

- Properties — Descriptive attributes that provide context and validation rules for your data resources.
- There are special properties, like `descriptions` or `tests`, that are solely defined in `YAML` files alongside resources. They cannot be set in config blocks or the `dbt_project.yml` file since they offer static, context-specific details rather than hierarchical configurations.
- Configurations — Instruct dbt on how to build and maintain them efficiently in your data warehouse environment.

Refer to [About configs and properties](/reference/configs-and-properties) for more details.

Properties or configurations support different resource types and are applied in different ways. The following table describes each resource type, its supported properties and configurations, and how they are applied.

| Resource type | Supported properties | Supported configurations | Config inheritance |
| --------------| -------------------- | ----------------------- | ------------------ |
| Exposures | description, columns, tests, docs, macros | tags, materialized, and so on. | `properties.yml``.yml file``dbt_project.yml` |
| Group | |
| Macro | |
| Models | columns, tests, docs, macros | tags, materialized, persist_docs, tags, and so on. | `properties.yml``.yml file``dbt_project.yml` |
| Saved Query | |
| Semantic Model | |
| Seeds | tests, macros | tags, persist_docs, and so on. | In-file `config()` block → `.yml file``dbt_project.yml` |
| Snapshots | tests, macros | tags, materialized, and so on.| In-file `config()` block → `.yml file``dbt_project.yml` |
| Sources | description, columns, tests, docs, macros | tags, persist_docs, and so on. | `properties.yml``.yml file``dbt_project.yml` |
| Tests | description, tags, macros | | In-file `config()` block → `.yml file``dbt_project.yml` |
| | | | | |
| Configurations | In-file `config()` block → `.yml file``dbt_project.yml` |
| | | | | |
| Special Properties | description, tests, docs, columns, quote, source properties, exposure properties, macro properties | | `properties.yml` |



## Related docs
- [About resource paths](/reference/resource-configs/resource-path)
- [About configs and properties](/reference/configs-properties)
7 changes: 5 additions & 2 deletions website/docs/reference/configs-and-properties.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Configs, properties, what are they?
title: About configs and properties
---

Resources in your project—models, snapshots, seeds, tests, and the rest—can have a number of declared **properties**. Resources can also define **configurations**, which are a special kind of property that bring extra abilities. What's the distinction?
Expand Down Expand Up @@ -85,6 +85,7 @@ These properties are:
- [`macro` properties](/reference/macro-properties) (e.g. `arguments`)

## Example

Here's an example that defines both `sources` and `models` for a project:

<File name='models/jaffle_shop.yml'>
Expand Down Expand Up @@ -152,6 +153,8 @@ models:
</File>



<!--
## Related documentation
You can find an exhaustive list of each supported property and config, broken down by resource type:
* Model [properties](/reference/model-properties) and [configs](/reference/model-configs)
Expand All @@ -161,6 +164,7 @@ You can find an exhaustive list of each supported property and config, broken do
* Analysis [properties](analysis-properties)
* [Macro Properties](/reference/macro-properties)
* Exposure [properties](/reference/exposure-properties)
-->

## FAQs
<FAQ path="Project/schema-yml-name" />
Expand All @@ -171,7 +175,6 @@ You can find an exhaustive list of each supported property and config, broken do
<FAQ path="Project/yaml-file-extension" />

## Troubleshooting common errors

### Invalid test config given in [model name]

This error occurs when your `.yml` file does not conform to the structure expected by dbt. A full error message might look like:
Expand Down
3 changes: 2 additions & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,9 @@ const sidebarSettings = {
type: "category",
label: "Resource configs and properties",
items: [
"reference/configs-and-properties",
"reference/about-resources",
"reference/resource-configs/resource-path",
"reference/configs-and-properties",
{
type: "category",
label: "General properties",
Expand Down

0 comments on commit 4f24c81

Please sign in to comment.