Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify macro properties aren't supported in dbt_project.yml #3989

Merged
merged 45 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0a8b4bf
clarify macro aren't support in project.yml file
mirnawong1 Aug 30, 2023
907fde4
Merge branch 'current' into mwong-macro-yml
mirnawong1 Aug 31, 2023
cda991a
add snippet and rephrase
mirnawong1 Aug 31, 2023
66ff1df
Update dbt_project.yml.md
mirnawong1 Aug 31, 2023
293e437
Merge branch 'current' into mwong-macro-yml
mirnawong1 Aug 31, 2023
b163c5b
Update website/docs/reference/macro-properties.md
mirnawong1 Aug 31, 2023
ddd2c63
Update website/docs/reference/macro-properties.md
mirnawong1 Aug 31, 2023
237f6da
Merge branch 'mwong-macro-yml' of https://github.com/dbt-labs/docs.ge…
mirnawong1 Aug 31, 2023
6d8ce4e
update lang
mirnawong1 Aug 31, 2023
0b5a949
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 4, 2023
49d7b63
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 6, 2023
9a9627a
tweak snippet and add versionblock
mirnawong1 Sep 6, 2023
a56d9a8
remove break
mirnawong1 Sep 6, 2023
db04b02
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 7, 2023
3d8dbd6
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 11, 2023
d22b7e9
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 11, 2023
a24c149
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 11, 2023
b01215a
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 13, 2023
d5c881f
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 13, 2023
a453e7a
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 13, 2023
f4ccb57
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 14, 2023
30c7c4d
Merge branch 'current' into mwong-macro-yml
mirnawong1 Sep 18, 2023
02fb137
adding jerco's great feedback
mirnawong1 Sep 18, 2023
1872ce1
clarify
mirnawong1 Sep 18, 2023
56fbe0a
change yaml to `properties.yml`
mirnawong1 Sep 18, 2023
75b1457
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 6, 2023
b5e6f28
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 7, 2023
5ec1c05
add table
mirnawong1 Nov 7, 2023
95b430d
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 8, 2023
ef8c3bc
Update configs-and-properties.md
mirnawong1 Nov 8, 2023
06740f1
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 9, 2023
02a3cae
Remove trailing space
dbeatty10 Nov 10, 2023
fa206ce
Merge branch 'current' into mwong-macro-yml
dbeatty10 Nov 10, 2023
f353599
Merge branch 'current' into mwong-macro-yml
dbeatty10 Nov 10, 2023
29c32df
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 13, 2023
6c4a0c6
Merge branch 'current' into mwong-macro-yml
dbeatty10 Nov 13, 2023
5baf269
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 15, 2023
ca47c06
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 20, 2023
e332c34
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 22, 2023
a1a8e7f
Update docs.md
mirnawong1 Nov 22, 2023
169f759
Merge branch 'current' into mwong-macro-yml
mirnawong1 Nov 29, 2023
e27bb9d
Merge branch 'current' into mwong-macro-yml
dbeatty10 Dec 17, 2023
7ad36fd
Update dbt_project.yml.md
dbeatty10 Dec 17, 2023
c26bc39
Remove extra newline
dbeatty10 Dec 17, 2023
9225af1
Merge branch 'current' into mwong-macro-yml
mirnawong1 Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading