Fix: Direct breaking category should only impact direct children snapshot#3975
Conversation
sqlmesh/core/plan/builder.py
Outdated
| direct_parent_categories.append(parent.change_category) | ||
|
|
||
| if not categories or any( | ||
| if not direct_parent_categories or any( |
There was a problem hiding this comment.
if there are no direct parent categories, but then grandparent A is forward only, is this still correct?
There was a problem hiding this comment.
How can there be no direct parent categories?
There was a problem hiding this comment.
Note: it's direct parent not direct category
There was a problem hiding this comment.
Sorry, let me rephrase the question. How can there be a grandparent category but not a parent category?
There was a problem hiding this comment.
i’m not sure, is there a case of a revert or something where it’s possible?
There was a problem hiding this comment.
Right now, I'm having a hard time coming up with a scenario like this. A scenario like this would indicate that there's an orphaned uncategorized new snapshot which is somehow indirectly modified. I think falling back to breaking in this case seems reasonable.
In a DAG that looks like
A -> B -> C, if the user makes aBreakingchange toAand aNon-breakingchange toB, thenCshould be categorized asIndirect Non-Breakingrather thanIndirect Breaking, as it was before this change.At the same time, if
Awas categorized asForward-OnlyandBasNon-Breaking, SQLMesh should prefer theForward-onlycategory forCover theIndirect Non-Breakingone.