Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate mechanism for reading environment variables #10100

Open
MichelleArk opened this issue May 7, 2024 · 0 comments
Open

Consolidate mechanism for reading environment variables #10100

MichelleArk opened this issue May 7, 2024 · 0 comments
Labels
tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality

Comments

@MichelleArk
Copy link
Contributor

MichelleArk commented May 7, 2024

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).

@MichelleArk MichelleArk added the tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality
Projects
None yet
Development

No branches or pull requests

1 participant