-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[#3885] Skip partial parsing if project env vars change #4212
Conversation
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.
Just spent some time playing around with these changes. Looking good so far!
166aaff
to
4beaa25
Compare
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.
Working great in local testing. Good to go from my perspective.
Let's make sure someone is able to give this PR + #4162 a quick code review on Monday morning, so that we can have both in rc1
.
proj_env_vars_changed = '09_project_env_vars_changed' | ||
prof_env_vars_changed = '10_profile_env_vars_changed' |
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.
👍
# There will never be any project_env_vars when it's first created | ||
project_env_vars: Dict[str, Any] = {} |
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 this true? With the new interactive init
you can technically put in env_vars. Either way they're "changing" since they're new so not sure how much it matters.
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.
Yes. The project_env_vars only come from rendering, which happens after the object is created. So whether or not env vars exist before the dbt code starts up doesn't matter.
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.
LGTM but I'd be happier is someone else took a look too.
logger.info("Unable to do partial parsing because env vars " | ||
"used in dbt_project.yml have changed") | ||
valid = False | ||
reparse_reason = ReparseReason.proj_env_vars_changed | ||
if self.manifest.state_check.profile_env_vars_hash != \ | ||
manifest.state_check.profile_env_vars_hash: | ||
logger.info("Unable to do partial parsing because env vars " | ||
"used in profiles.yml have changed") |
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.
Depending on what goes in first (this or #4055) , this will need to be updated to the new struct logging as well as anywhere else logging is happening. Nothing to do now - more of a reminder for later.
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.
I think we should have a walkthrough next week since everything is all crunchy right now.
4beaa25
to
c449da1
Compare
resolves #3885
Description
This pull request captures the env vars when the dbt_project.yml file is rendered and saves a checksum of them in the manifest.state_check. When partial parsing is attempted it will compare the checksums and skip partial parsing if they have changed.
Profile env vars have also been handled. Note: only the specified profile is actually rendered.
Checklist
CHANGELOG.md
and added information about my change