Skip to content

Commit

Permalink
clarify macro aren't support in project.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Aug 30, 2023
1 parent a489d7a commit 0a8b4bf
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 15 deletions.
5 changes: 3 additions & 2 deletions website/docs/reference/dbt_project.yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ By default, dbt will look for `dbt_project.yml` in your current working director

</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.
:::

The following is a list of all available configurations in the `dbt_project.yml` file. Something to note, [Macro properties](/reference/macro-properties) aren't supported in the `dbt_project.yml` file:

<File name='dbt_project.yml'>

```yml
Expand Down
4 changes: 2 additions & 2 deletions website/docs/reference/macro-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: Macro properties
---

Macro properties can be declared in `.yml` files.
Macro properties can be declared in `.yml` files, except in the `dbt_project.yml` files.

You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders.
You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in sub-folders.

<File name='macros/<filename>.yml'>

Expand Down
78 changes: 67 additions & 11 deletions website/docs/reference/resource-configs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,35 @@ default_value: {show: true}
{ label: 'Macros', value: 'macros', },
]
}>

<TabItem value="models">

You can use the docs property in YAML files, including the `dbt_project.yml`:

<File name='dbt_project.yml'>

```yml
name: "your_dbt_project_name"
version: "1.0.0"
config-version: 2

models:
- name: model_name
docs:
show: true | false
```
</File>
<File name='models/schema.yml'>
```yml
version: 2

models:
- name: model_name
docs:
show: true | false

```
</File>
Expand All @@ -43,6 +60,22 @@ This property is not implemented for sources.
<TabItem value="seeds">
You can use the docs property in YAML files, including the `dbt_project.yml`:

<File name='dbt_project.yml'>

```yml
name: "your_dbt_project_name"
version: "1.0.0"
config-version: 2
seeds:
- name: seed_name
docs:
show: true | false
```
</File>

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

```yml
Expand All @@ -52,15 +85,29 @@ seeds:
- name: seed_name
docs:
show: true | false

```

</File>

</TabItem>

<TabItem value="snapshots">

You can use the docs property in YAML files, including the `dbt_project.yml`:

<File name='dbt_project.yml'>

```yml
name: "your_dbt_project_name"
version: "1.0.0"
config-version: 2
snapshots:
- name: snapshot_name
docs:
show: true | false
```
</File>

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

```yml
Expand All @@ -70,15 +117,29 @@ snapshots:
- name: snapshot_name
docs:
show: true | false

```

</File>

</TabItem>

<TabItem value="analyses">

You can use the docs property in YAML files, including the `dbt_project.yml`:

<File name='dbt_project.yml'>

```yml
name: "your_dbt_project_name"
version: "1.0.0"
config-version: 2
analyses:
- name: analysis_name
docs:
show: true | false
```
</File>

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

```yml
Expand All @@ -89,16 +150,13 @@ analyses:
docs:
show: true | false
```
</File>

</TabItem>

<TabItem value="macros">

<!----
To-do: check this
--->
You can use the docs property in YAML files, _except_ in `dbt_project.yml`. [Macro properties](/reference/macro-properties) _are not_ supported in the `dbt_project.yml` file.

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

Expand All @@ -109,9 +167,7 @@ macros:
- name: macro_name
docs:
show: true | false

```

</File>

</TabItem>
Expand Down

0 comments on commit 0a8b4bf

Please sign in to comment.