question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Defining vars, folder-level configs outside dbt_project.yml

See original GitHub issue

Describe 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 a variables.yml file that could be imported in dbt-project.yml . And for that matter, the same could be done for other configurations in the dbt_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:open
  • Created 3 years ago
  • Reactions:11
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
krazavet-tinycluescommented, Feb 11, 2022

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 🙏

0reactions
itechprasanthcommented, Aug 29, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found