-
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
state:modified vars, behind "state_modified_compare_vars" behaviour flag #10793
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10793 +/- ##
==========================================
+ Coverage 89.16% 89.20% +0.04%
==========================================
Files 183 183
Lines 23258 23344 +86
==========================================
+ Hits 20738 20825 +87
+ Misses 2520 2519 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Associated schemas PR: dbt-labs/schemas.getdbt.com#64 |
@@ -58,19 +70,21 @@ def __call__(self, var_name, default=Var._VAR_NOTSET): | |||
all_vars.add(my_config.vars.vars_for(lookup, adapter_type)) | |||
all_vars.add(active_vars) | |||
|
|||
if var_name in all_vars: | |||
return all_vars[var_name] | |||
if not var_found and var_name in all_vars: |
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.
This refactor was primarily for the happiness of our linting tools. There was no final return statement on the method in the past.
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
Resolves #4304
Problem
With #10675, we removed the capability for dbt to (sometimes) detect changes in vars as modifying models/dbt resources that depended on them (behind a behaviour flag).
Solution
This behaviour is actually desired (distinction between env_var and var), so let's introduce state:modified.vars as a standalone selector method as well as a default. This is also behind a behaviour flag in case existing users rely on the current var state:modified selection behaviour (flawed as it is!).
Checklist