You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this only applies to Function, or if it affects all non-slice ColumnBase classes.
For context, we did run into this in a real-world use-case.
Expected Behavior
I'm not 100% sure, but at the very least this probably should raise rather than infinitely loop, which is worse because it is silent and effectively a memory leak.
Proposed Solutions
(Disclaimer: I'm not deeply familiar with peewee's internals, so this is more directional than a fully thought-out solution.)
Problem
Both of these examples produce an infinite loop:
The offending code is
ColumnBase.__getitem__
: https://github.com/coleifer/peewee/blob/master/peewee.py#L1236-L1242I'm not sure if this only applies to
Function
, or if it affects all non-sliceColumnBase
classes.For context, we did run into this in a real-world use-case.
Expected Behavior
I'm not 100% sure, but at the very least this probably should
raise
rather than infinitely loop, which is worse because it is silent and effectively a memory leak.Proposed Solutions
(Disclaimer: I'm not deeply familiar with
peewee
's internals, so this is more directional than a fully thought-out solution.)From the Python docs:
So if raising in all non-slice cases doesn't make sense, perhaps just raising an
IndexError
at the appropriate time (e.g. after 1 loop)?The text was updated successfully, but these errors were encountered: