File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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(
12461246 drop_axes = indexer .drop_axes ,
12471247 )
12481248 if indexer .shape == ():
1249- return out_buffer .as_numpy_array ().item ()
1249+ return cast ( out_buffer .as_numpy_array ().item (), out_buffer . dtype )
12501250 return out_buffer .as_ndarray_like ()
12511251
12521252 async def getitem (
@@ -2209,7 +2209,7 @@ def _iter_chunk_regions(
22092209
22102210 def __array__ (
22112211 self , dtype : npt .DTypeLike | None = None , copy : bool | None = None
2212- ) -> NDArrayLike :
2212+ ) -> npt . ArrayLike :
22132213 """
22142214 This method is used by numpy when converting zarr.Array into a numpy array.
22152215 For more information, see https://numpy.org/devdocs/user/basics.interoperability.html#the-array-method
@@ -2220,7 +2220,7 @@ def __array__(
22202220
22212221 arr_np = self [...]
22222222
2223- if dtype is not None :
2223+ if dtype is not None and hasattr ( arr_np , "astype" ) :
22242224 arr_np = arr_np .astype (dtype )
22252225
22262226 return arr_np
You can’t perform that action at this time.
0 commit comments