Activity log for bug #266907

Date Who What changed Old value New value Message
2008-09-05 21:25:55 Brad Crittenden bug added bug
2008-09-05 21:26:11 Brad Crittenden bug assigned to storm
2008-09-05 21:28:06 Brad Crittenden title Slicing of Storm result sets override previous slices Slicing of Storm result sets overrides previous slices
2008-09-05 21:34:42 Francis J. Lacoste description Code in a database class like: return self.all_active[:quantity] will subsequently be batched by the API. The batching code causes the result set to get sliced again, which ignores the previous slice. So, if quantity=3 and the batching size=5 then the batch returned will actually have 5 items. Code in a database class like: return self.all_active[:quantity] will subsequently be batched by the API. The batching code causes the result set to get sliced again, which ignores the previous slice. So, if quantity=3 and the batching size=5 then the batch returned will actually have 5 items. Notes: all_active is a storm ResultSet (or SQLObjectResultSet works identically). The effect of slicing is only of setting start and limit attributes on the result set. Another slice will override it ignoring the previous slicing. So where in python you'd expect >>> [1, 2, 3, 4, 5][:3][:5] [1, 2, 3] In Storm, (giving that find() here returns at least 5 objects), you'd get: >>> results = store.find(...)[:3][:5] [1, 2, 3, 4, 5]
2009-11-11 06:02:51 Curtis Hovey launchpad-foundations: status New Triaged
2009-11-11 06:02:55 Curtis Hovey launchpad-foundations: importance Undecided Low