diff --git a/xarray/core/indexing.py b/xarray/core/indexing.py index 1447f00df05..8fe172f6d25 100644 --- a/xarray/core/indexing.py +++ b/xarray/core/indexing.py @@ -577,7 +577,7 @@ def __array__( self, dtype: np.typing.DTypeLike = None, /, *, copy: bool | None = None ) -> np.ndarray: if Version(np.__version__) >= Version("2.0.0"): - return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy) # type: ignore[call-overload] + return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy) else: return np.asarray(self.get_duck_array(), dtype=dtype) @@ -1652,7 +1652,8 @@ def _oindex_get(self, indexer: OuterIndexer): # manual orthogonal indexing (implemented like DaskIndexingAdapter) value = self.array - for axis, subkey in reversed(list(enumerate(indexer))): + subkey: Any + for axis, subkey in reversed(list(enumerate(indexer))): # type: ignore value = value[(slice(None),) * axis + (subkey, Ellipsis)] return value @@ -1693,7 +1694,8 @@ def _oindex_get(self, indexer: OuterIndexer): except NotImplementedError: # manual orthogonal indexing value = self.array - for axis, subkey in reversed(list(enumerate(indexer))): + subkey: Any + for axis, subkey in reversed(list(enumerate(indexer))): # type: ignore value = value[(slice(None),) * axis + (subkey,)] return value