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 which node / resource types support node_color #4493

Merged
merged 15 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions website/docs/reference/analysis-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ analyses:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
config:
[tags](/reference/resource-configs/tags): <string> | [<string>]
columns:
Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/model-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ models:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[latest_version](/reference/resource-properties/latest_version): <version_identifier>
[deprecation_date](/reference/resource-properties/deprecation_date): <YAML_DateTime>
[access](/reference/resource-configs/access): private | protected | public
Expand Down
15 changes: 10 additions & 5 deletions website/docs/reference/resource-configs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ models:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")

```

Expand All @@ -44,7 +45,7 @@ models:
- name: model_name
docs:
show: true | false
node_color: "black"
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -67,7 +68,7 @@ seeds:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false

node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```

</File>
Expand All @@ -81,6 +82,7 @@ seeds:
- name: seed_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -97,6 +99,7 @@ snapshots:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")

```

Expand All @@ -111,6 +114,7 @@ snapshots:
- name: snapshot_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -130,6 +134,7 @@ analyses:
- name: analysis_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -156,7 +161,7 @@ macros:
</Tabs>

## Definition
The docs field can be used to provide documentation-specific configuration to models. It supports the doc attribute `show`, which controls whether or not models are shown in the auto-generated documentation website. It also supports `node_color` for some node types.
The docs field can be used to provide documentation-specific configuration to models. It supports the doc attribute `show`, which controls whether or not models are shown in the auto-generated documentation website. It also supports `node_color` for models, seeds, snapshots, and analyses. Other node types are not supported.

**Note:** Hidden models will still appear in the dbt DAG visualization but will be identified as "hidden.”

Expand Down Expand Up @@ -204,9 +209,9 @@ models:

## Custom node colors

The `docs` attribute now supports `node_color` to customize the display color of some node types in the DAG within dbt docs. You can define node colors in the files below and apply overrides where needed.
The `docs` attribute now supports `node_color` to customize the display color of some node types in the DAG within dbt docs. You can define node colors in the following files and apply overrides where needed. Note, you need to run or re-run the command `dbt docs generate`.

`node_color` hiearchy:
`node_color` hierarchy:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eagle eyes! 🦅


`<example-sql-file.sql>` overrides `schema.yml` overrides `dbt_project.yml`

Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/seed-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ seeds:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[config](/reference/resource-properties/config):
[<seed_config>](/reference/seed-configs): <config_value>
[tests](/reference/resource-properties/data-tests):
Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/snapshot-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ snapshots:
[meta](/reference/resource-configs/meta): {<dictionary>}
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[config](/reference/resource-properties/config):
[<snapshot_config>](/reference/snapshot-configs): <config_value>
[tests](/reference/resource-properties/data-tests):
Expand Down
Loading