-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-1470] Whither UserConfig? #6207
Comments
How would we feel about a precedence order like:
Idea being:
|
This comment is my attempt to summarize my latest thinking on the next steps here. Given the last few months of Fun With Flags, I think a solid answer here could provide us with much cleaner codepaths & initialization flows going forward. As always, we should aim to provide one minor version of back-compat for existing behavior, with deprecation warnings, if we can manage it. Big idea: "Runtime configuration" can be provided by users in one of three ways:
Commentary:
|
I wonder if we can simplify the code/configuration but just having folks move to use .env files by having more support for these. What does a .yml config give that .env doesn't? If we do want got the route of a dbt_config file, it would probably be handy to set per stage / environment configurations. Either declaratively by supporting: |
Thanks @colin-rogers-dbt @gshank @dbeatty10 for talking through this live during BLG!
Inside PASSENV=DBT_* SPECIFIC_ENV_VAR Or for everything:
I do want to think more about this. My initial instinct is, per-environment configuration should be solved for with environment variables ( Good idea: Let's call this something like
It does allow us to:
|
Factor III in a twelve-factor app is " Config: Store config in the environment". One way to load environment-specific environment variables is using Using A pro of The cons are that it isn't a Python program, and installation instructions are system-specific. Also, anytime there is a change to |
@jtcohen6 this is eye-catching:
What would be the consequences, pros, and cons of never reading env variables directly from the system when there is a |
@dbeatty10 Hah, it felt a bit controversial when I wrote it too! I'm not all the way sold on it myself. It would be a way of "exporting" the environment into a file, and providing predictability/portability: wherever dbt runs, it uses the environment variables defined in that file, rather than the system / environment it's running in. This was a need we'd identified while working on runtimes for It might be sufficient (and less controversial) for |
➕ This makes sense to me |
Recent work on dynamic profiles has exposed another problem with All of this is to say that we might want to look at a more structured configuration format like toml or even json-schema alongside a simple .env file. |
@colin-rogers-dbt That makes sense to me — though it sounds more like something we'd want to address in a (long-overdue) rework of |
@jtcohen6 sorry I could have written this clearer: I meant this in a more general "flat" or unstructured configs come with significant downsides way not that we solve for profiles.yml here.
Tots agree, not saying this config would replace those checks as they are currently written (we have to support them now) but that it might encourage us to structure the flags differently in the future to encourage better ergonomics and it would allow us to surface the existing complexity in a more user friendly way. An extreme case is how spark manages it's configuration: configuration is pretty error prone as it's very easy to set conflicting flags many of which will silently change the application's behavior in unpredictable ways. |
Closing this in favor of #9183 :) |
https://docs.getdbt.com/docs/core/connect-data-platform/profiles.yml#user-config
The idea in the past has been: This is tied to my specific "machine," and should hold true / set defaults for all of my dbt activity. The original options were things like: don't use colors in the terminal, don't send anonymous usage tracking, don't use partial parsing. Those aren't tied to any one dbt project in particular, and they might be different for different users — hence, why they weren't stored in the project codebase and checked into version control.
However, these configs don't really have anything to do with connection profiles / credentials. We're all about splitting up our monolithic files. And
profiles.yml
really deserves a bigger refresh next year (#1958 and then some).Questions:
dbt_project.yml
? In a new root-level file that lives alongside the project? Should that file be.gitignored
(a ladbt.env
), or version-controlled (dbt_config.yml
)?--log-path
and--target-path
as CLI flag / env var overrides already blurs that boundary. That said, I don't think--model-paths
should really be a thing :)Wherever we move the
UserConfig
, we'll need to support it in its current location for a period of time, with a clear deprecation warning.The text was updated successfully, but these errors were encountered: