-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add default values for --exclude
to dbt_profile.yml
#2746
Comments
@tjwaterman99 Thanks for the detailed writeup!
I'm glad to hear you're giving real thought to onboarding new dbt developers, and I want to be sure that there are dbt constructs to support you in doing this. It sounds like you almost always don't want to be running the tutorial models. Is there a reason why you wouldn't want to:
models:
tutorial:
enabled: "{{ var('tutorial', false) | as_bool }}" dbt run -m +tutorial --vars 'tutorial: true' As far as the specific proposal to store a default set of node selectors in the profile, thereby altering the default behavior of I think that the configs in
And I think there are other better places to store these "shared settings":
I'm curious to hear if any of the above resonates with you, or if you have other ideas! |
Hey @jtcohen6, I think using the I'll try that out and close this issue. Thanks for your insight! |
@jtcohen6 I am in a similar situation to @tjwaterman99 and would like to use the It looks like the node selector is not able to recognize that the models have been enabled by the command line argument, so I am using dbt version 0.19.1 using dbt Cloud, the relevant part of my dbt_project.yml is:
And the command I am running is:
This log then shows:
Is this solution still expected to work? Also, in my case, creating a separate dbt project could make sense, but I would like to avoid setting up a new repository just for the 4 expensive models. I checked the docs and it seems possible to have multiple projects in a single repo, but not sure how to do it with the dbt Cloud IDE - any pointers on that? |
@ethanjahn Sorry for the delayed response here. I think what you're seeing is the result of a bug (https://github.com/fishtown-analytics/dbt/issues/3126), which unfortunately means that, within the RPC server (which the dbt Cloud IDE uses), In the meantime, this should work if, instead of setting As for the original thrust of this issue, I've come around on the need for changing the default include/exclude criteria, and I think yaml selectors may be just the way to do it. I just opened #3448 to continue that discussion. |
Describe the feature
I'd like to be able to skip building some models by default in my project's development environment.
For example, my team has a set of models under
models/tutorial
that are used to help onboard new users into the project. However, those models are not useful for the production schema or our documentation, and we'd like to exclude them.One way to do this would be to add a
defaults
section to the.dbt/profiles.yml
configuration.The
profiles.yml
file already has default parameter selections, namely the--target
value and number of--threads
. This would extend those defaults to another parameter:--exclude
.This pattern is also popular in other packages, such as pytest's configuration for
addopts
.Describe alternatives you've considered
dbt_project.yml
file for development environments with a separatesource-paths
value. But this solution meant we would need to maintain the all of the other values across both files, such as any data in thevars
section, which isn't DRY.dbt
command, such as inbin/dbt
, which did something likedbt --exclude tutorial $@
. But that would be confusing for my team because they'd have to remember to use our custombin/dbt
command instead of the command referenced in all of DBT's documentation. I'm also not sure it would still allow them to use the--exclude
flag themselves.Who will this benefit?
This benefits teams that want to maintain a production environment that doesn't include all of the models in their development environments.
Are you interested in contributing this feature?
I would be happy to contribute! But this would be a large change to the
profiles.yml
file, so I wanted to see if others would benefit before seeing how far I could get.The text was updated successfully, but these errors were encountered: