Skip to content

[vars] [false negatives] Changes in used variables do not cause models to be selected by state:modified #4304

@CyberShadow

Description

@CyberShadow

Hi there,

In https://docs.getdbt.com/reference/node-selection/state-comparison-caveats, it is stated:

Vars

If a model uses a var or env_var in its definition, dbt is unable today to identify that lineage in such a way that it can include the model in state:modified because the var or env_var value has changed.

I was wondering if there is an issue tracking this limitation; I searched for one and couldn't find one, so I hope it's OK that I opened this issue so that our team can follow its status. (If there was one and I missed it, apologies!)

Also, I apologize for the naive question, but would it not be easier, at least for the case where the desired effect is to re-run all changed models and their children, to check if the source code after preprocessing (Jinja macro expansion) has changed, instead of before? I would expect that this would automatically cause changes in variables to propagate to changes to the compiled code of the models, which would then indicate a need to re-run them.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    paper_cutA small change that impacts lots of users in their day-to-daystateStateful selection (state:modified, defer)state: modified

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions