From 6b64e06765a2a74e583d52c5bdc59061df838111 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:21:48 -0600 Subject: [PATCH] Clarify order of precedence for global configs (#4363) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Preview](https://docs-getdbt-com-git-dbeatty-global-configs-prec-329ad4-dbt-labs.vercel.app/reference/global-configs/about-global-configs) resolves #4362 ## What are you changing in this pull request and why? Two things: 1. When quickly scanning docs, make it easy to see the order of precedence for global configs 1. Include hyperlinks to the three different ways that a global config can be set ([user config](https://docs.getdbt.com/reference/global-configs/yaml-configurations), [environment variable](https://docs.getdbt.com/reference/global-configs/environment-variable-configs), [CLI flag](https://docs.getdbt.com/reference/global-configs/command-line-flags)) ### History [This](https://github.com/dbt-labs/docs.getdbt.com/blob/35a59491ffc6133a26e0c52b9a8e9a3f96d405f3/website/docs/reference/global-configs/about-global-configs.md) is the current page for "Global Configs", and [this](https://github.com/dbt-labs/docs.getdbt.com/blob/533637af17b296e17a19eb4582da0123ddc8b572/website/docs/reference/global-configs.md) was the page prior to https://github.com/dbt-labs/docs.getdbt.com/pull/3332. ### 🎩 image ## 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 have verified the preview renders correctly - [x] I have verified any new links work correctly --------- Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- .../reference/global-configs/about-global-configs.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/about-global-configs.md b/website/docs/reference/global-configs/about-global-configs.md index 42819cdac8f..9d1691812b5 100644 --- a/website/docs/reference/global-configs/about-global-configs.md +++ b/website/docs/reference/global-configs/about-global-configs.md @@ -8,4 +8,11 @@ Global configs enable you to fine-tune _how_ dbt runs projects on your machine Global configs control things like the visual output of logs, the manner in which dbt parses your project, and what to do when dbt finds a version mismatch or a failing model. These configs are "global" because they are available for all dbt commands, and because they can be set for all projects running on the same machine or in the same environment. -Starting in v1.0, you can set global configs in three places. When all three are set, command line flags take precedence, then environment variables, and last yaml configs (usually `profiles.yml`). \ No newline at end of file +### Global config precedence + +Starting in v1.0, you can set global configs in three places. dbt will evaluate the configs in the following order: +1. [user config](https://docs.getdbt.com/reference/global-configs/yaml-configurations) +1. [environment variable](https://docs.getdbt.com/reference/global-configs/environment-variable-configs) +1. [CLI flag](https://docs.getdbt.com/reference/global-configs/command-line-flags) + +Each config is prioritized over the previous one. For example, if all three are provided, then the CLI flag takes precedence.