dbt-labs / dbt-labs/dbt

Consolidate mechanism for reading environment variables

Open
#10,100 1 comment 2 reactions 0 assignees View on GitHub
engine:v1 type:tech-debt
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

We currently have about 4 ways to read environment variables:
1. click
2. invocation context
* provides a level of isolation between dbt command invocations (e.g. in dbt Runner)
* isolated test environments
* (to confirm specifics) only reads `DBT_SECRET` and `DBT_`-prefixed environment variables.
3. via `os` builtin package

Let's explore a standard recommended way for doing this, even if we may not be able to get around using click for parsing CLI options. Most likely we should just move away from (3) and to (2), and keep (1).

A note... we could also explore using pydantic for this use case, but unclear what the benefits would be over (2).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.