-
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
Decouple project creation logic from tasks CT-299 #4981
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
user_config = read_user_config(flags.PROFILES_DIR) | ||
# Update flags | ||
flags.set_from_args(args, user_config) | ||
profile = Profile.render_from_args(args, ProfileRenderer(cli_vars), profile_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like cli_vars is only used when a profile is not provided, is it safe to assume that the provided profile will always have cli_vars set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to assume that the provided profile will always have cli_vars set
Nope, but the profile is valid wether or not it has cli_vars
so we don't need to do anything special here.
return "models" | ||
|
||
@property | ||
def project_config(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the test be a unit test that only test get_project_config
's function? This would work but I feel like it is harder to know exactly what is being tested if just reading the code.
Resolves #4804
Description
Adds a utility to dbt.config to allow for ad-hoc project object generation
Additional context
This isn't a great solution-- A much better pattern would be to untangle the way we current launch tasks and incorporate a built-the-project-first approach as a first class citizen instead of a random config util. I started work down that path but issues with our various context managers and time limitations have foiled that plan. The work done in that direction can be seen on this WIP branch and will be useful in future cli-related work.
Checklist