diff --git a/xarray/namedarray/utils.py b/xarray/namedarray/utils.py index 33c199d6f8d..7804a9b4b49 100644 --- a/xarray/namedarray/utils.py +++ b/xarray/namedarray/utils.py @@ -9,7 +9,6 @@ Any, Callable, Final, - Literal, Protocol, SupportsIndex, TypeVar, @@ -26,9 +25,9 @@ from typing_extensions import TypeGuard if sys.version_info >= (3, 11): - from typing import Self + pass else: - from typing_extensions import Self + pass from dask.array.core import Array as DaskArray from dask.typing import DaskCollection diff --git a/xarray/tests/test_namedarray.py b/xarray/tests/test_namedarray.py index 1b6bf42acf7..9e13a92d197 100644 --- a/xarray/tests/test_namedarray.py +++ b/xarray/tests/test_namedarray.py @@ -11,6 +11,7 @@ if TYPE_CHECKING: from types import ModuleType + from numpy.typing import NDArray from xarray.namedarray.utils import (