-
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
[CT-231] [Bug] Macro change not picked up by state:modified+ if macro is invoked after an unchanged macro in the model code #4678
Comments
Thanks for the detailed writeup @saraleon1! I was able to reproduce this locally. Both models show both macros in their
I'm pretty sure the problem lies in the recursive logic for this method (no surprise, I wrote this code): dbt-core/core/dbt/graph/selector_methods.py Lines 452 to 467 in f3c7b6b
Namely, if the first macro doesn't have any dependencies of its own, we if len(macro_node.depends_on.macros) > 0:
return self.recursively_check_macros_modified(macro_node, previous_macros)
elif len(node.depends_on.macros) > len(previous_macros):
continue
else:
return False This returns the correct result:
|
@leahwicz This showed up in BLG today but it's already been closed, maybe check the GHA code to see why it's still open in Jira? Note-- the JIRA ticket seems to ber a duplicate (See CT-163 and CT-231) |
Is there an existing issue for this?
Current Behavior
In dbt core version 1.0.0, if you reference an unchanged macro in model code before referencing the changed macro, the macro change will not be picked up by the state:modified+ flag. For example, if I have 2 macros:
and
Referenced in 2 different models like so:
and the second model is:
and then make a change and pull request against the macro 'changed macro', only the first model will run when invoked by:
dbt build --select state:modified+
This looks to be due to the order in which the macros are called in the model.
Expected Behavior
both models are identified as modified, regardless of the order in which macros are called in the model code
Steps To Reproduce
and:
and:
dbt build --select state:modified+
Relevant log output
What database are you using dbt with?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: