Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
BUG: maximum recursion error when replacing empty lists #22083
Internal mechanism in replace method is intertwined and can cause RecursionError (not very helpful). Discussed in #21977, there doesn't appear to be first class support for ExtensionArray yet and this issue is right now treated as error handling, having investigated treating it as new use case but not easily co-exist without large change.
The RecursionError is caused by
New approach is now to prevent re-casting of blocks to object blocks if it is already an ObjectBlock and instead raise the error caught as it is, because if it's an ObjectBlock already then ValueError and TypeError raised won't go away when re-casted to object and re-try, resulting in infinite loop and RecursionError.
@@ Coverage Diff @@ ## master #22083 +/- ## ========================================== + Coverage 92.06% 92.06% +<.01% ========================================== Files 169 169 Lines 50694 50698 +4 ========================================== + Hits 46671 46675 +4 Misses 4023 4023