diff --git a/xarray/namedarray/_typing.py b/xarray/namedarray/_typing.py index 7de44240530..0b972e19539 100644 --- a/xarray/namedarray/_typing.py +++ b/xarray/namedarray/_typing.py @@ -3,7 +3,6 @@ from collections.abc import Hashable, Iterable, Mapping, Sequence from types import ModuleType from typing import ( - TYPE_CHECKING, Any, Callable, Protocol, @@ -16,10 +15,6 @@ import numpy as np -if TYPE_CHECKING: - from numpy.typing import NDArray - - # https://stackoverflow.com/questions/74633074/how-to-type-hint-a-generic-numpy-array _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) @@ -234,7 +229,7 @@ class _sparsearray( Corresponds to np.ndarray. """ - def todense(self) -> NDArray[_ScalarType_co]: + def todense(self) -> np.ndarray[Any, _DType_co]: ...