From 81992fd35323871be2339b621e78aed42ce6dc8a Mon Sep 17 00:00:00 2001
From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Date: Thu, 12 Dec 2024 15:09:09 +0000
Subject: [PATCH 1/7] add supported examples for alias
this pr adds additional examples for the `alias` config for the supported resources. missing examples were for dbt_projct.yml, properties.yml, and sql config block (depending on the resource)
Resolves #6512
---
.../docs/reference/resource-configs/alias.md | 112 ++++++++++++++++--
1 file changed, 102 insertions(+), 10 deletions(-)
diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md
index c14804ef2a7..33e577ec5a4 100644
--- a/website/docs/reference/resource-configs/alias.md
+++ b/website/docs/reference/resource-configs/alias.md
@@ -8,9 +8,11 @@ datatype: string
-Specify a custom alias for a model in your `dbt_project.yml` file or config block.
+Specify a custom alias for a model in your `dbt_project.yml` file, `models/properties.yml` file, or config block in a SQL file.
-For example, if you have a model that calculates `sales_total` and want to give it a more user-friendly alias, you can alias it like this:
+For example, if you have a model that calculates `sales_total` and want to give it a more user-friendly alias, you can alias it as shown in the following examples.
+
+In the `dbt_project.yml` file, the following example sets a default `alias` for the `sales_total` model at the project level:
@@ -22,16 +24,40 @@ models:
```
+In the `models/properties.yml` file, the following specifies an `alias` as part of the model's metadata, useful for centralized configuration:
+
+
+
+```yml
+version: 2
+
+models:
+ - name: sales_total
+ config:
+ alias: sales_dashboard
+```
+
+
+In `models/sales_total.sql` file, the following assigns the `alias` directly in the model file:
+
+
+
+```sql
+{{ config(
+ alias="sales_dashboard"
+) }}
+```
+
+
This would return `analytics.finance.sales_dashboard` in the database, instead of the default `analytics.finance.sales_total`.
+Configure a seed's alias in your `dbt_project.yml` file or a `properties.yml` file. The following examples demonstrate how to `alias` a seed named `product_categories` to `categories_data`.
-Configure a seed's alias in your `dbt_project.yml` file or config block.
-
-For example, if you have a seed that represents `product_categories` and want to alias it as `categories_data`, you would alias like this:
+In the `dbt_project.yml` file at the project level:
@@ -41,6 +67,21 @@ seeds:
product_categories:
+alias: categories_data
```
+
+
+In the `seeds/properties.yml` file:
+
+
+
+```yml
+version: 2
+
+seeds:
+ - name: product_categories
+ config:
+ alias: categories_data
+```
+
This would return the name `analytics.finance.categories_data` in the database.
@@ -65,7 +106,9 @@ seeds:
Configure a snapshots's alias in your `dbt_project.yml` file or config block.
-For example, if you have a snapshot that is named `your_snapshot` and want to alias it as `the_best_snapshot`, you would alias like this:
+The following examples demonstrate how to `alias` a snapshot named `your_snapshot` to `the_best_snapshot`.
+
+In the `dbt_project.yml` file at the project level:
@@ -75,20 +118,57 @@ snapshots:
your_snapshot:
+alias: the_best_snapshot
```
+
-This would build your snapshot to `analytics.finance.the_best_snapshot` in the database.
+In the `snapshots/properties.yml` file:
+
+
+```yml
+version: 2
+
+snapshots:
+ - name: your_snapshot
+ config:
+ alias: the_best_snapshot
+```
+
+
+In `snapshots/your_snapshot.sql` file:
+
+
+
+```sql
+{{ config(
+ alias="the_best_snapshot"
+) }}
+```
+This would build your snapshot to `analytics.finance.the_best_snapshot` in the database.
+
-Configure a test's alias in your `schema.yml` file or config block.
+Configure a data test's alias in your `dbt_project.yml` file, `properties.yml` file, or config block in the model file.
+
+The following examples demonstrate how to `alias` a unique data test named `order_id` to `unique_order_id_test` to identify a specific data test.
-For example, to add a unique test to the `order_id` column and give it an alias `unique_order_id_test` to identify this specific test, you would alias like this:
+In the `dbt_project.yml` file at the project level:
-
+
+
+```yml
+tests:
+ your_project:
+ +alias: unique_order_id_test
+```
+
+
+In the `models/properties.yml` file:
+
+
```yml
models:
@@ -99,6 +179,18 @@ models:
- unique:
alias: unique_order_id_test
```
+
+
+In `tests/unique_order_id_test.sql` file:
+
+
+
+```sql
+{{ config(
+ alias="unique_order_id_test",
+ severity="error",
+```
+
When using [`store_failures_as`](/reference/resource-configs/store_failures_as), this would return the name `analytics.finance.orders_order_id_unique_order_id_test` in the database.
From 8df1848f2c31fbffb618a80f2cbf3a82dbb10761 Mon Sep 17 00:00:00 2001
From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Date: Thu, 12 Dec 2024 15:21:24 +0000
Subject: [PATCH 2/7] Update alias.md
---
website/docs/reference/resource-configs/alias.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md
index 33e577ec5a4..66e9e3f1074 100644
--- a/website/docs/reference/resource-configs/alias.md
+++ b/website/docs/reference/resource-configs/alias.md
@@ -96,9 +96,6 @@ seeds:
+alias: country_mappings
```
-
-
-
From ff4a383b0ff4008b170f9fc6b1dd8b4be1382565 Mon Sep 17 00:00:00 2001
From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Date: Thu, 12 Dec 2024 15:48:28 +0000
Subject: [PATCH 3/7] Update alias.md
---
website/docs/reference/resource-configs/alias.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md
index 66e9e3f1074..b568c437fa9 100644
--- a/website/docs/reference/resource-configs/alias.md
+++ b/website/docs/reference/resource-configs/alias.md
@@ -191,7 +191,7 @@ In `tests/unique_order_id_test.sql` file:
When using [`store_failures_as`](/reference/resource-configs/store_failures_as), this would return the name `analytics.finance.orders_order_id_unique_order_id_test` in the database.
-
+
From 445aec0593954f99d46777a2a40b98683b9eb376 Mon Sep 17 00:00:00 2001
From: "Leona B. Campbell" <3880403+runleonarun@users.noreply.github.com>
Date: Thu, 12 Dec 2024 20:40:23 -0500
Subject: [PATCH 4/7] Reducing page complexity and typo (#6654)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## What are you changing in this pull request and why?
* reducing the duplicate titles
* Removing extra H1
## Checklist
- [ ] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [ ] I have added checklist item(s) to this list for anything anything
that needs to happen before this PR is merged, such as "needs technical
review" or "change base branch."
- [ ] The content in this PR requires a dbt release note, so I added one
to the [release notes
page](https://docs.getdbt.com/docs/dbt-versions/dbt-cloud-release-notes).
---
🚀 Deployment available! Here are the direct links to the updated files:
-
https://docs-getdbt-com-git-runleonarun-patch-15-dbt-labs.vercel.app/docs/core/connect-data-platform/dremio-setup
---
.../docs/docs/core/connect-data-platform/dremio-setup.md | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/website/docs/docs/core/connect-data-platform/dremio-setup.md b/website/docs/docs/core/connect-data-platform/dremio-setup.md
index 21d0ee2956b..69f2b14fc4f 100644
--- a/website/docs/docs/core/connect-data-platform/dremio-setup.md
+++ b/website/docs/docs/core/connect-data-platform/dremio-setup.md
@@ -60,10 +60,6 @@ Next, configure the profile for your project.
When you initialize a project, you create one of these three profiles. You must configure it before trying to connect to Dremio Cloud or Dremio Software.
-## Profiles
-
-When you initialize a project, you create one of these three profiles. You must configure it before trying to connect to Dremio Cloud or Dremio Software.
-
* Profile for Dremio Cloud
* Profile for Dremio Software with Username/Password Authentication
* Profile for Dremio Software with Authentication Through a Personal Access Token
@@ -149,9 +145,7 @@ For descriptions of the configurations in these profiles, see [Configurations](#
-## Configurations
-
-### Configurations Common to Profiles for Dremio Cloud and Dremio Software
+## Configurations Common to Profiles for Dremio Cloud and Dremio Software
| Configuration | Required? | Default Value | Description |
From b230d39c6c6e9f28affb9b3e97ac9a39d2a294f9 Mon Sep 17 00:00:00 2001
From: "Leona B. Campbell" <3880403+runleonarun@users.noreply.github.com>
Date: Thu, 12 Dec 2024 21:36:52 -0500
Subject: [PATCH 5/7] add to our yaml style best practice guide (#6662)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes https://github.com/dbt-labs/docs.getdbt.com/issues/1686
## What are you changing in this pull request and why?
* added that a YAML list is accepted as a string.
* Not adding a new page because winnie did this amazing best practice
guide after this issue was filed.
## Checklist
- [ ] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [ ] I have added checklist item(s) to this list for anything anything
that needs to happen before this PR is merged, such as "needs technical
review" or "change base branch."
- [ ] The content in this PR requires a dbt release note, so I added one
to the [release notes
page](https://docs.getdbt.com/docs/dbt-versions/dbt-cloud-release-notes).
---
🚀 Deployment available! Here are the direct links to the updated files:
-
https://docs-getdbt-com-git-runleonarun-patch-16-dbt-labs.vercel.app/best-practices/how-we-style/5-how-we-style-our-yaml
---------
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
---
.../docs/best-practices/how-we-style/5-how-we-style-our-yaml.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/website/docs/best-practices/how-we-style/5-how-we-style-our-yaml.md b/website/docs/best-practices/how-we-style/5-how-we-style-our-yaml.md
index 8f817356334..e3b539e8b12 100644
--- a/website/docs/best-practices/how-we-style/5-how-we-style-our-yaml.md
+++ b/website/docs/best-practices/how-we-style/5-how-we-style-our-yaml.md
@@ -7,6 +7,7 @@ id: 5-how-we-style-our-yaml
- 2️⃣ Indents should be two spaces
- ➡️ List items should be indented
+- 🔠 List items with a single entry can be a string. For example, `'select': 'other_user'`, but it's best practice to provide the argument as an explicit list. For example, `'select': ['other_user']`
- 🆕 Use a new line to separate list items that are dictionaries where appropriate
- 📏 Lines of YAML should be no longer than 80 characters.
- 🛠️ Use the [dbt JSON schema](https://github.com/dbt-labs/dbt-jsonschema) with any compatible IDE and a YAML formatter (we recommend [Prettier](https://prettier.io/)) to validate your YAML files and format them automatically.
From 56e47da64aaeebc1ffcde068d41cbb7b8c2d16f7 Mon Sep 17 00:00:00 2001
From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Date: Fri, 13 Dec 2024 09:11:22 +0000
Subject: [PATCH 6/7] Update website/docs/reference/resource-configs/alias.md
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
---
website/docs/reference/resource-configs/alias.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md
index b568c437fa9..dbb772ccee4 100644
--- a/website/docs/reference/resource-configs/alias.md
+++ b/website/docs/reference/resource-configs/alias.md
@@ -24,7 +24,7 @@ models:
```
-In the `models/properties.yml` file, the following specifies an `alias` as part of the model's metadata, useful for centralized configuration:
+The following specifies an `alias` as part of the `models/properties.yml` file metadata, useful for centralized configuration:
From 7af79c48688538f0cf31d0bfd06fbf121d9b8f4a Mon Sep 17 00:00:00 2001
From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com>
Date: Fri, 13 Dec 2024 09:11:38 +0000
Subject: [PATCH 7/7] Update website/docs/reference/resource-configs/alias.md
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
---
website/docs/reference/resource-configs/alias.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md
index dbb772ccee4..5beaa238806 100644
--- a/website/docs/reference/resource-configs/alias.md
+++ b/website/docs/reference/resource-configs/alias.md
@@ -38,7 +38,7 @@ models:
```
-In `models/sales_total.sql` file, the following assigns the `alias` directly in the model file:
+The following assigns the `alias` directly in the In `models/sales_total.sql` file: