Skip to content

Commit

Permalink
Callout snippet for properties and configs (#4439)
Browse files Browse the repository at this point in the history
### Previews
- [Source
properties](https://docs-getdbt-com-git-dbeatty-config-properties-callout-dbt-labs.vercel.app/reference/source-properties)
- [Exposure
properties](https://docs-getdbt-com-git-dbeatty-config-properties-callout-dbt-labs.vercel.app/reference/exposure-properties)
- [Analysis
properties](https://docs-getdbt-com-git-dbeatty-config-properties-callout-dbt-labs.vercel.app/reference/analysis-properties)
- [Macro
properties](https://docs-getdbt-com-git-dbeatty-config-properties-callout-dbt-labs.vercel.app/reference/macro-properties)

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

These changes were authored by @mirnawong1 as part of #3989.

This adds a common callout about properties vs. configs near the top of
the following pages:
- [Source
properties](https://docs.getdbt.com/reference/source-properties)
- [Exposure
properties](https://docs.getdbt.com/reference/exposure-properties)
- [Analysis
properties](https://docs.getdbt.com/reference/analysis-properties)
- [Macro properties](https://docs.getdbt.com/reference/macro-properties)

### 🎩 
When rendered, the snippet generally looks like this:

<img width="818" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/d9f8a093-94e5-40e3-a7d9-bf960c99049d">

## 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 looked at the previews and everything is rendering okay
  • Loading branch information
mirnawong1 authored Nov 13, 2023
2 parents 7f8ac8c + ad51209 commit 0cb4856
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 3 additions & 1 deletion website/docs/reference/analysis-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: Analysis properties
---

We recommend you define analysis properties in your `analyses/` directory, which is illustrated in the [`analysis-paths`](/reference/project-configs/analysis-paths) configuration.
import PropsCallout from '/snippets/_config-prop-callout.md';

We recommend you define analysis properties in your `analyses/` directory, which is illustrated in the [`analysis-paths`](/reference/project-configs/analysis-paths) configuration. <PropsCallout title={frontMatter.title}/> <br />

You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders within the `analyses/` or `models/` directory.

Expand Down
6 changes: 5 additions & 1 deletion website/docs/reference/exposure-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ description: "Read this guide to understand exposure properties in dbt."
- [Declaring resource properties](/reference/configs-and-properties)

## Overview
Exposures are defined in `.yml` files nested under an `exposures:` key. You may define `exposures` in YAML files that also define define `sources` or `models`.

import PropsCallout from '/snippets/_config-prop-callout.md';

Exposures are defined in `properties.yml` files nested under an `exposures:` key. You may define `exposures` in YAML files that also define `sources` or `models`. <PropsCallout title={frontMatter.title}/> <br />


You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders within the `models/` directory.

Expand Down
7 changes: 5 additions & 2 deletions website/docs/reference/macro-properties.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
title: Macro properties
id: macro-properties
---

Macro properties can be declared in `.yml` files.
import PropsCallout from '/snippets/_config-prop-callout.md';

You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders.
Macro properties can be declared in any `properties.yml` file. <PropsCallout title={frontMatter.title}/>

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

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

Expand Down
8 changes: 6 additions & 2 deletions website/docs/reference/source-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ description: "Learn how to use source properties in dbt."
- [Declaring resource properties](/reference/configs-and-properties)

## Overview
Source properties can be declared in `.yml` files in your `models/` directory (as defined by the [`model-paths` config](/reference/project-configs/model-paths)).

You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders within the `models/` directory.
import PropsCallout from '/snippets/_config-prop-callout.md';

Source properties can be declared in any `properties.yml` file in your `models/` directory (as defined by the [`model-paths` config](/reference/project-configs/model-paths)). <PropsCallout title={frontMatter.title}/> <br />


You can name these files `whatever_you_want.yml`, and nest them arbitrarily deeply in subfolders within the `models/` directory:

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

Expand Down
1 change: 1 addition & 0 deletions website/snippets/_config-prop-callout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span>{props.title} are "special properties" in that you can't configure them in the <code>dbt_project.yml</code> file or using <code>config()</code> blocks. Refer to <a href="https://docs.getdbt.com/reference/configs-and-properties#which-properties-are-not-also-configs" target="_self"> Configs and properties</a> for more info.</span>

0 comments on commit 0cb4856

Please sign in to comment.