Defining vars, folder-level configs outside dbt_project.yml
See original GitHub issueDescribe the feature
From @benjaminsingleton:
I’d like to use project level variables more, but I’m concerned about bloat to my already large
dbt-project.yml
file. I think it would be helpful if I could create avariables.yml
file that could be imported in dbt-project.yml . And for that matter, the same could be done for other configurations in thedbt_project.yml
file. I think having the ability to separate configurations into different files might make for improved modularity / separation of concerns (particularly for large projects), not to mention fewer merge conflicts. CC @jrandrews
Describe alternatives you’ve considered
- We’re already thinking of enabling some configs in resource-YAML files (#2401), but these would be at the level of the individual resource (model/seed/snapshot/etc) only
- The
dbt_project.yml
gets really really big??
Additional context
- I don’t think this has any correspondence to v1.0. It’s a nice thing to have, and we can could do it before, after, any time without it being a breaking change in any way.
Who will this benefit?
- Developers and maintainers of increasingly big dbt projects
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:9 (2 by maintainers)
Top Results From Across the Web
reference a global var in yml file in dbt - Stack Overflow
yml file in dbt. For example, if I have a column or a table name that is defined as a global in my...
Read more >Upgrading to 0.17.0 | dbt Developer Hub - dbt Docs
A new dbt_project.yml config version ... of dbt allowed variables ( vars: ) to be scoped to a folder level in the models:...
Read more >Can you store variables in a custom YML file in your model?
This basically isn't possible without declaring a variable in dbt_project.yml. You can use environment variables or regular Jinja statements, ...
Read more >pytest Documentation - Read the Docs
pytest -h | --help # show help on command line and config file options ... you can run the test module and get...
Read more >dbt for Data Transformation - A Hands-on Tutorial
It allows you to create complex models, use variables and macros (aka ... A dbt project is a directory containing .sql and .yml...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello 👋
In our company, we are using a lot DBT in a multi tenant context. For that purpose, we rely a lot on DBT variables with which we propagate the client configuration. Those configurations could be really different from a client to another. Sometimes we have faced the following issue
argument list too long: dbt
, which is due to the large config payload (e.g. some of them could reach more than 600Kb).We did not find a proper workaround for now. Passing a file path instead of a payload for our variables would probably solve our issue. This is why we are keen to know if there is any chance you are going to consider such feature for DBT ? (cc. @jtcohen6)
Thank you in advance 🙏
I agree. Hope this will get implemented soon as it is always a good practice to modularize the configurations, rather than having everything in same single file.