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
Reposition before recursion in fixes to avoid internal error #3658
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.
Looks like a simple enough fix. But would be good if @barrywhart can review too.
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.
Nice, elegant fix! My intuition was that we needed to do the positioning "top down", but there was a high risk I'd fumble around for a loonngg time working out the details.
Thanks!! 🙌
A dbt test is failing:
|
Yeah I saw this, and I'm really not sure why 🤔 . I feel like I've uncovered a bigger bug. |
Ok, no I understand what's going on - by repositioning early - the matching of fixes to segments goes wrong. They no longer "find" their target because it's not the same segment. Will rethink approach. |
NOTE: This now includes the changes from #3661 to confirm that they solve the test fails I was otherwise getting. That will make the diff look weird but means we should merge the other PR first if all looks good. |
Codecov Report
@@ Coverage Diff @@
## main #3658 +/- ##
========================================
Coverage 99.99% 100.00%
========================================
Files 176 176
Lines 13348 13350 +2
========================================
+ Hits 13347 13350 +3
+ Misses 1 0 -1
Continue to review full report at Codecov.
|
This resolves #3656 .
The issue was caused by child segments trying to apply fixes to segments inserted or edited by a parent which hadn't yet assigned position markers using
_position_segments
. This simply adds an intermediate step after applying fixes to the parent where we optionally repositionself
before applying fixes to children.This will add a very slight performance overhead, but I don't think the
fix
routine is currently the bottleneck. Potentially in future we might be able to more selectively run this routine, but for now this feels ok. Added a test case too.