File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1246,7 +1246,7 @@ async def _get_selection(
1246
1246
drop_axes = indexer .drop_axes ,
1247
1247
)
1248
1248
if indexer .shape == ():
1249
- return out_buffer .as_numpy_array ().item ()
1249
+ return cast ( out_buffer .as_numpy_array ().item (), out_buffer . dtype )
1250
1250
return out_buffer .as_ndarray_like ()
1251
1251
1252
1252
async def getitem (
@@ -2209,7 +2209,7 @@ def _iter_chunk_regions(
2209
2209
2210
2210
def __array__ (
2211
2211
self , dtype : npt .DTypeLike | None = None , copy : bool | None = None
2212
- ) -> NDArrayLike :
2212
+ ) -> npt . ArrayLike :
2213
2213
"""
2214
2214
This method is used by numpy when converting zarr.Array into a numpy array.
2215
2215
For more information, see https://numpy.org/devdocs/user/basics.interoperability.html#the-array-method
@@ -2220,7 +2220,7 @@ def __array__(
2220
2220
2221
2221
arr_np = self [...]
2222
2222
2223
- if dtype is not None :
2223
+ if dtype is not None and hasattr ( arr_np , "astype" ) :
2224
2224
arr_np = arr_np .astype (dtype )
2225
2225
2226
2226
return arr_np
You can’t perform that action at this time.
0 commit comments