From 1f6099766c0c72beb4c0803bd64099df4fbe85f6 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:52:57 -0700 Subject: [PATCH 1/7] Explain behavior of `config.get` --- website/docs/reference/dbt-jinja-functions/config.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index 3903c82eef7..10049e1a985 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -34,13 +34,21 @@ __Args__: The `config.get` function is used to get configurations for a model from the end-user. Configs defined in this way are optional, and a default value can be provided. +There are 3 cases: +1. The configuration variable exists, it is it not `None` +1. The configuration variable exists, it it is `None` +1. The configuration variable does not exist + Example usage: ```sql {% materialization incremental, default -%} -- Example w/ no default. unique_key will be None if the user does not provide this configuration {%- set unique_key = config.get('unique_key') -%} - -- Example w/ default value. Default to 'id' if 'unique_key' not provided + -- Example w/ alternate value. Use alternative of 'id' if 'unique_key' config is provided, but it is None + {%- set unique_key = config.get('unique_key') or 'id' -%} + + -- Example w/ default value. Default to 'id' if the 'unique_key' config does not exist {%- set unique_key = config.get('unique_key', default='id') -%} ... ``` From 5f069bc339700bb5ca8d8e83d6c593a2b129a361 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:47:09 +0000 Subject: [PATCH 2/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index 10049e1a985..7c628ab7b10 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -35,7 +35,7 @@ __Args__: The `config.get` function is used to get configurations for a model from the end-user. Configs defined in this way are optional, and a default value can be provided. There are 3 cases: -1. The configuration variable exists, it is it not `None` +1. The configuration variable exists, it is not `None` 1. The configuration variable exists, it it is `None` 1. The configuration variable does not exist From 06a6ebc7bfe4a2b4c0f277ce055657afebbb8d0e Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:47:14 +0000 Subject: [PATCH 3/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index 7c628ab7b10..8083ea2a124 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -36,7 +36,7 @@ The `config.get` function is used to get configurations for a model from the end There are 3 cases: 1. The configuration variable exists, it is not `None` -1. The configuration variable exists, it it is `None` +1. The configuration variable exists, it is `None` 1. The configuration variable does not exist Example usage: From 4c78b8d6faf37f8ee9272f3fa09b6670a3349972 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:47:43 +0000 Subject: [PATCH 4/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index 8083ea2a124..c9d93b80eb1 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -35,7 +35,7 @@ __Args__: The `config.get` function is used to get configurations for a model from the end-user. Configs defined in this way are optional, and a default value can be provided. There are 3 cases: -1. The configuration variable exists, it is not `None` +1. The configuration variable exists, it isn't `None` 1. The configuration variable exists, it is `None` 1. The configuration variable does not exist From 3df2adc94816a956c4e8d6ae02aacde02594c214 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:48:01 +0000 Subject: [PATCH 5/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index c9d93b80eb1..d5d3c550ba7 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -37,7 +37,7 @@ The `config.get` function is used to get configurations for a model from the end There are 3 cases: 1. The configuration variable exists, it isn't `None` 1. The configuration variable exists, it is `None` -1. The configuration variable does not exist +1. The configuration variable doesn't exist Example usage: ```sql From 65d3786070f82c20f3b88d36e807abe60a648502 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:49:10 +0000 Subject: [PATCH 6/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index d5d3c550ba7..44cc8778b3b 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -35,7 +35,7 @@ __Args__: The `config.get` function is used to get configurations for a model from the end-user. Configs defined in this way are optional, and a default value can be provided. There are 3 cases: -1. The configuration variable exists, it isn't `None` +1. The configuration variable exists, it is not `None` 1. The configuration variable exists, it is `None` 1. The configuration variable doesn't exist From 82ebebf2b37251ca0113d08bf8b271b8d73df696 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:49:21 +0000 Subject: [PATCH 7/7] Update website/docs/reference/dbt-jinja-functions/config.md --- website/docs/reference/dbt-jinja-functions/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/dbt-jinja-functions/config.md b/website/docs/reference/dbt-jinja-functions/config.md index 44cc8778b3b..8083ea2a124 100644 --- a/website/docs/reference/dbt-jinja-functions/config.md +++ b/website/docs/reference/dbt-jinja-functions/config.md @@ -37,7 +37,7 @@ The `config.get` function is used to get configurations for a model from the end There are 3 cases: 1. The configuration variable exists, it is not `None` 1. The configuration variable exists, it is `None` -1. The configuration variable doesn't exist +1. The configuration variable does not exist Example usage: ```sql