-
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
dbt_project.yml v2 #2300
Comments
An example dbt_project.yml file that conforms to the v2 spec:
The config keyThe
From this syntax alone, it is not clear that
If one of these keys is found in the varsToday, vars are scoped hierarchically in a dbt project. There isn't a ton of merit to doing it this way, and it's more a fallout of the initial implementation than it is a well-considered design decision. The big downside of this approach is that variable resolution is hard to reason about, and hard to implement in dbt. For models, folder-scoped variables are reasonably well defined. Consider:
Here, the Consider the following two files:
In this example, both Let's try to collect some feedback here around how folks are using
Let's keep the goals in mind here (consistency, unambiguity, ease of parsing) and remain flexible on the exact implementation that we move forwards with. |
Yes love all of this. Yeah, there's never a time when I use I'm in favour of I would also be in favor of: models:
project_name:
materialized: view
enabled: true
tags: ['my_project']
base:
my_big_table:
materialized: table
materialization_configs: # ok not this but something like this
partition_by:
field_name: date_day
data_type: date For me, there's a difference between the configs that a materialization uses (and are consumed in Jinja-land), versus configs that are consumed by the python parts of dbt. IDK if that's valid though |
|
In fact, you only need:
Everything else is optional 😄 Speaking of, while we're here, do we want to do something about |
I agree! This appears to be the cause of a decent amount of confusion. Unfortunately, this is very tricky to specify without also breaking schema.yml behavior and/or creating ambiguities. Currently
This should just be required to be a project name. I actually thought it was that way already, though config resolution is currently so opaque I could easily be wrong. |
@clrcrl Everything is optional but if you do want to specify a file path, that specification is required at startup :) And good ping on |
It's used by the hubsite to determine what version a project is, I thought? |
No, not at all. Hubsite uses GitHub releases |
@beckjake I don't fully understand the challenges you're describing here, although I certainly trust that you're correct. My hope would be that we not totally give up on moving towards that desirable end-state without a fight though :) I'm very game to hop on a call to dig in further on this topic if others have an appetite to do that. |
@jthandy more than happy to do so! Just so everyone can follow along, this is a currently valid
That
It's not possible to mix lists and dicts in yaml, so this naive merge of the
I think we probably could get this to work, but I don't love it - I think it's even less intuitive than having two config files:
|
I really like the proposed solution for handling |
Describe the feature
dbt_project.yml should get a version 2. We can denote it by adding an optional
config-version:
field that defaults to v1 and encourage users to migrate to v2 by creating a migration script.Many of these changes will enable/make it easier to implement #2269 and #2283 - in fact, v2 will probably be required for those features. It'll also make fixing #2265 a lot easier.
The changes:
models
config block will be split out intoseeds
,models
,analyses
,sources
, etc.config
- that key will denote the actual values to be applied to the config.config
in the search paths will be an error.vars
its own top-level key.vars
will be project-scoped only, no full paths/FQNsvars
in config blocks will be treated as a config value namedvars
.We should provide a migration path: 0.17.0 will support both versions (but you can't have the "good stuff" on v1) and emit deprecation warnings. 0.18.0 will only support v2.
Describe alternatives you've considered
We can just not do it.
Additional context
N/A
Who will this benefit?
anyone developing sources
The text was updated successfully, but these errors were encountered: