Skip to content

Commit

Permalink
Merge branch 'current' into mwong-detailstoggle-ff
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Dec 18, 2023
2 parents 8c7913d + cb5c283 commit cf9a46f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions contributing/content-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ Some common Latin abbreviations and other words to use instead:
| i.e. | that is | Use incremental models when your dbt runs are becoming too slow (that is, don't start with incremental models) |
| e.g. | <ul><li>for example</li><li>like</li></ul> | <ul><li>Join both the dedicated #adapter-ecosystem channel in dbt Slack and the channel for your adapter's data store (for example, #db-sqlserver and #db-athena)</li><li>Using Jinja in SQL provides a way to use control structures (like `if` statements and `for` loops) in your queries </li></ul> |
| etc. | <ul><li>and more</li><li>and so forth</li></ul> | <ul><li>A continuous integration environment running pull requests in GitHub, GitLab, and more</li><li>While reasonable defaults are provided for many such operations (like `create_schema`, `drop_schema`, `create_table`, and so forth), you might need to override one or more macros when building a new adapter</li></ul> |
| N.B. | note | Note: State-based selection is a powerful, complex feature. |

https://www.thoughtco.com/n-b-latin-abbreviations-in-english-3972787

### Prepositions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This article covers an approach to handling time-varying ragged hierarchies in a

To help visualize this data, we're going to pretend we are a company that manufactures and rents out eBikes in a ride share application. When we build a bike, we keep track of the serial numbers of the components that make up the bike. Any time something breaks and needs to be replaced, we track the old parts that were removed and the new parts that were installed. We also precisely track the mileage accumulated on each of our bikes. Our primary analytical goal is to be able to report on the expected lifetime of each component, so we can prioritize improving that component and reduce costly maintenance.

<!--truncate-->

## Data model

Obviously, a real bike could have a hundred or more separate components. To keep things simple for this article, let's just consider the bike, the frame, a wheel, the wheel rim, tire, and tube. Our component hierarchy looks like:
Expand Down
10 changes: 4 additions & 6 deletions website/docs/reference/configs-and-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Configs, properties, what are they?
---

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?
- Properties are declared for resources one-by-one in `.yml` files. Configs can be defined there, nested under a `config` property. They can also be set one-by-one via a `config()` macro (right within `.sql` files), and for many resources at once in `dbt_project.yml`.
- Properties are declared for resources one-by-one in `properties.yml` files. Configs can be defined there, nested under a `config` property. They can also be set one-by-one via a `config()` macro (right within `.sql` files), and for many resources at once in `dbt_project.yml`.
- Because configs can be set in multiple places, they are also applied hierarchically. An individual resource might _inherit_ or _override_ configs set elsewhere.
- You can select resources based on their config values using the `config:` selection method, but not the values of non-config properties

Expand Down Expand Up @@ -46,9 +46,7 @@ Most configurations are "clobbered" when applied hierarchically. Whenever a more

## Where can I define properties?

In dbt, properties are declared in `.yml` files, in the same directory as your resources.

You can name these files `whatever_you_want.yml` and nest them arbitrarily deeply in subfolders within each directory.
In dbt, you can use `properties.yml` files to define properties for resources. You can declare properties in `.yml` files, in the same directory as your resources. You can name these files `whatever_you_want.yml` and nest them arbitrarily in sub-folders within each directory.

We highly recommend that you define properties in dedicated paths alongside the resources they're describing.

Expand All @@ -58,13 +56,13 @@ We highly recommend that you define properties in dedicated paths alongside the

Previous versions of the docs referred to these as `schema.yml` files — we've moved away from that terminology since the word `schema` is used to mean other things when talking about databases, and people often thought that you _had_ to name these files `schema.yml`.

(Of course, you're still free to name your files `schema.yml`)
Instead, we now refer to these files as `properties.yml` files. (Of course, you're still free to name your files `schema.yml`)

:::

### Which properties are _not_ also configs?

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.
In dbt, you can define node configs in `properties.yml` files, in addition to `config()` blocks and `dbt_project.yml`. However, some special properties can only be defined in the `.yml` file and you cannot configure them using `config()` blocks or the `dbt_project.yml` file:

Certain properties are special, because:

Expand Down
8 changes: 5 additions & 3 deletions website/docs/reference/dbt_project.yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ Starting from dbt v1.5 and higher, you can specify your dbt Cloud project ID in

</VersionBlock>

The following is a list of all available configurations in the `dbt_project.yml` file.

:::info YAML syntax
dbt uses YAML in a few different places. If you're new to YAML, it would be worth taking the time to learn how arrays, dictionaries and strings are represented.
dbt uses YAML in a few different places. If you're new to YAML, it would be worth taking the time to learn how arrays, dictionaries, and strings are represented.
:::


Something to note, you can't set up a "property" in the `dbt_project.yml` file if it's not a config (an example is [macros](/reference/macro-properties)). This applies to all types of resources. Refer to [Configs and properties](/reference/configs-and-properties) for more detail.

The following example is a list of all available configurations in the `dbt_project.yml` file:

<VersionBlock firstVersion="1.7">

<File name='dbt_project.yml'>
Expand Down

0 comments on commit cf9a46f

Please sign in to comment.