def _proc_array(self, arr, itemproc, dim, collection):
if dim is None:
- if arr is None:
- arr = []
- else:
- arr = list(arr)
- if dim == 1 or dim is None and not hasattr(arr[0], '__iter__'):
+ arr = list(arr)
+ if dim == 1 or dim is None and (
+ not arr or not hasattr(arr[0], '__iter__')):
if itemproc:
return collection(itemproc(x) for x in arr)
else:
7
)
+ def test_undim_array_empty(self):
+ arrtable = self.tables.arrtable
+ self._fixture_456(arrtable)
+ eq_(
+ testing.db.scalar(
+ select([arrtable.c.intarr]).
+ where(arrtable.c.intarr.contains([]))
+ ),
+ [4, 5, 6]
+ )
+
def test_array_getitem_slice_exec(self):
arrtable = self.tables.arrtable
testing.db.execute(