Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Oct 14, 2023
1 parent 117b850 commit f5bc328
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ def _nonzero(self: T_NamedArrayInteger) -> tuple[T_NamedArrayInteger, ...]:
# TODO: we should replace dask's native nonzero
# after https://github.com/dask/dask/issues/1076 is implemented.
# TODO: cast to ndarray and back to T_DuckArray is a workaround
nonzeros = np.nonzero(cast(NDArray[np.integer[Any]], self.data))
nonzeros = np.nonzero(cast("NDArray[np.integer[Any]]", self.data))
_attrs = self.attrs
return tuple(
cast(T_NamedArrayInteger, _new(self, (dim,), nz, _attrs))
cast("T_NamedArrayInteger", _new(self, (dim,), nz, _attrs))
for nz, dim in zip(nonzeros, self.dims)
)

Expand Down

0 comments on commit f5bc328

Please sign in to comment.