From bb35b3eb87ab2543247fd6ea51f6043bb89a1f89 Mon Sep 17 00:00:00 2001 From: Leo Griffiths Date: Tue, 7 Nov 2023 19:34:38 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20get=5Fcustom=5Fdatabase=20docs=20describ?= =?UTF-8?q?e=20postfix=20when=20default=20behaviour=E2=80=A6=20(#9002)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: get_custom_database docs describe postfix when default behaviour is to take the custom database value directly, if provided * Changelog entry --- .changes/unreleased/Docs-20231106-123157.yaml | 6 ++++++ .../macros/get_custom_name/get_custom_database.sql | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Docs-20231106-123157.yaml diff --git a/.changes/unreleased/Docs-20231106-123157.yaml b/.changes/unreleased/Docs-20231106-123157.yaml new file mode 100644 index 00000000000..28b4cd8e755 --- /dev/null +++ b/.changes/unreleased/Docs-20231106-123157.yaml @@ -0,0 +1,6 @@ +kind: Docs +body: fix get_custom_database docstring +time: 2023-11-06T12:31:57.525711Z +custom: + Author: LeoTheGriff + Issue: "9003" diff --git a/core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql b/core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql index bb9b8c23807..108dc494404 100644 --- a/core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql +++ b/core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql @@ -2,8 +2,7 @@ Renders a database name given a custom database name. If the custom database name is none, then the resulting database is just the "database" value in the specified target. If a database override is specified, then - the resulting database is the default database concatenated with the - custom database. + the custom database name is used instead of the default "database" value. This macro can be overriden in projects to define different semantics for rendering a database name. @@ -13,6 +12,7 @@ node: The node the database is being generated for #} + {% macro generate_database_name(custom_database_name=none, node=none) -%} {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %} {%- endmacro %}