Skip to content

Commit

Permalink
Small formatting changes for configs & properties (#4438)
Browse files Browse the repository at this point in the history
### Previews
-
[configs-and-properties](https://docs-getdbt-com-git-dbeatty-config-properties-f-871117-dbt-labs.vercel.app/reference/configs-and-properties)
-
[dbt_project.yml](https://docs-getdbt-com-git-dbeatty-config-properties-f-871117-dbt-labs.vercel.app/reference/dbt_project.yml)
-
[docs](https://docs-getdbt-com-git-dbeatty-config-properties-f-871117-dbt-labs.vercel.app/reference/resource-configs/docs)
-
[source-properties](https://docs-getdbt-com-git-dbeatty-config-properties-f-871117-dbt-labs.vercel.app/reference/source-properties)

## What are you changing in this pull request and why?

These are small formatting these found while working on #3989.

Merging these changes independently will reduce the diffs in #3989 and
make easier to review some of the tricky technical content in that PR.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] I have examined each preview to make sure it looks correct
  • Loading branch information
dbeatty10 authored Nov 10, 2023
1 parent 6a3f30d commit 926c8ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
9 changes: 6 additions & 3 deletions website/docs/reference/configs-and-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A rule of thumb: properties declare things _about_ your project resources; confi

For example, you can use resource **properties** to:
* Describe models, snapshots, seed files, and their columns
- Assert "truths" about a model, in the form of [tests](/docs/build/tests), e.g. "this `id` column is unique"
* Assert "truths" about a model, in the form of [tests](/docs/build/tests), e.g. "this `id` column is unique"
* Define pointers to existing tables that contain raw data, in the form of [sources](/docs/build/sources), and assert the expected "freshness" of this raw data
* Define official downstream uses of your data models, in the form of [exposures](/docs/build/exposures)

Expand All @@ -35,11 +35,11 @@ dbt prioritizes configurations in order of specificity, from most specificity to

Note - Generic tests work a little differently when it comes to specificity. See [test configs](/reference/test-configs).

Within the project file, configurations are also applied hierarchically. The most-specific config always "wins": In the project file, configurations applied to a `marketing` subdirectory will take precedence over configurations applied to the entire `jaffle_shop` project. To apply a configuration to a model, or directory of models, define the resource path as nested dictionary keys.
Within the project file, configurations are also applied hierarchically. The most specific config always "wins": In the project file, configurations applied to a `marketing` subdirectory will take precedence over configurations applied to the entire `jaffle_shop` project. To apply a configuration to a model, or directory of models, define the resource path as nested dictionary keys.

### Combining configs

Most configurations are "clobbered" when applied hierarchically. Whenever a more-specific value is available, it will completely replace the less-specific value. Note that a few configs have different merge behavior:
Most configurations are "clobbered" when applied hierarchically. Whenever a more specific value is available, it will completely replace the less specific value. Note that a few configs have different merge behavior:
- [`tags`](tags) are additive. If a model has some tags configured in `dbt_project.yml`, and more tags applied in its `.sql` file, the final set of tags will include all of them.
- [`meta`](/reference/resource-configs/meta) dictionaries are merged (a more specific key-value pair replaces a less specific value with the same key)
- [`pre-hook` and `post-hook`](/reference/resource-configs/pre-hook-post-hook) are also additive.
Expand Down Expand Up @@ -67,12 +67,14 @@ Previous versions of the docs referred to these as `schema.yml` files — we've
dbt has the ability to define node configs in `.yml` files, in addition to `config()` blocks and `dbt_project.yml`. But the reverse isn't always true: there are some things in `.yml` files that can _only_ be defined there.

Certain properties are special, because:

- They have a unique Jinja rendering context
- They create new project resources
- They don't make sense as hierarchical configuration
- They're older properties that haven't yet been redefined as configs

These properties are:

- [`description`](/reference/resource-properties/description)
- [`tests`](/reference/resource-properties/tests)
- [`docs`](/reference/resource-configs/docs)
Expand Down Expand Up @@ -202,3 +204,4 @@ Runtime Error
```

This error occurred because a semicolon (`;`) was accidentally used instead of a colon (`:`) after the `description` field. To resolve issues like this, find the `.yml` file referenced in the error message and fix any syntax errors present in the file. There are online YAML validators that can be helpful here, but please be mindful of submitting sensitive information to third-party applications!

3 changes: 2 additions & 1 deletion website/docs/reference/dbt_project.yml.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Every [dbt project](/docs/build/projects) needs a `dbt_project.yml` file — this is how dbt knows a directory is a dbt project. It also contains important information that tells dbt how to operate on your project.
Every [dbt project](/docs/build/projects) needs a `dbt_project.yml` file — this is how dbt knows a directory is a dbt project. It also contains important information that tells dbt how to operate your project.

<VersionBlock lastVersion="1.4">

Expand Down Expand Up @@ -96,6 +96,7 @@ vars:
<VersionBlock lastVersion="1.5">
<File name='dbt_project.yml'>
```yml
Expand Down
10 changes: 2 additions & 8 deletions website/docs/reference/resource-configs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ default_value: {show: true}
{ label: 'Macros', value: 'macros', },
]
}>

<TabItem value="models">

<File name='models/schema.yml'>


```yml
version: 2

Expand All @@ -29,7 +31,6 @@ models:
docs:
show: true | false
node_color: "black"

```
</File>
Expand All @@ -53,9 +54,7 @@ seeds:
- name: seed_name
docs:
show: true | false

```

</File>
</TabItem>
Expand All @@ -71,9 +70,7 @@ snapshots:
- name: snapshot_name
docs:
show: true | false

```

</File>
</TabItem>
Expand All @@ -90,7 +87,6 @@ analyses:
docs:
show: true | false
```
</File>
</TabItem>
Expand All @@ -110,9 +106,7 @@ macros:
- name: macro_name
docs:
show: true | false

```

</File>
Also refer to [macro properties](/reference/macro-properties).
</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion website/docs/reference/source-properties.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "About source properties"
title: "Source properties"
description: "Learn how to use source properties in dbt."
---

Expand Down

0 comments on commit 926c8ce

Please sign in to comment.