Skip to content

Commit c94b85c

Browse files
author
Luke Shaw
committed
Fix casting to pass tests
1 parent c7d8696 commit c94b85c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blosc2/lazyexpr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,7 @@ def slices_eval_getitem(
16631663
ne_args = {}
16641664
where: dict | None = kwargs.pop("_where_args", None)
16651665

1666+
dtype = kwargs.pop("dtype", None)
16661667
if out is None:
16671668
# Compute the shape and chunks of the output array, including broadcasting
16681669
shape = compute_broadcast_shape(operands.values())
@@ -1700,7 +1701,7 @@ def slices_eval_getitem(
17001701
result = ne_evaluate(new_expr, slice_operands, **ne_args)
17011702

17021703
if out is None: # avoid copying unnecessarily
1703-
return result
1704+
return result.astype(dtype, copy=False) if dtype else result
17041705
else:
17051706
out[()] = result
17061707
return out

0 commit comments

Comments
 (0)