Skip to content

Commit

Permalink
Fix import error in _typing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Feb 2, 2024
1 parent 01c3d24 commit cda1b26
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions xarray/namedarray/_typing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import typing
from collections.abc import Hashable, Iterable, Mapping, Sequence
from enum import Enum
from types import ModuleType
Expand All @@ -19,12 +20,13 @@
import numpy as np
from numpy.typing import NDArray

try:
from dask.array.core import Array as DaskArray
from dask.typing import DaskCollection
except ImportError:
DaskArray = NDArray # type: ignore
DaskCollection: Any = NDArray # type: ignore
if typing.TYPE_CHECKING:
try:
from dask.array.core import Array as DaskArray
from dask.typing import DaskCollection
except ImportError:
DaskArray = NDArray # type: ignore
DaskCollection: Any = NDArray # type: ignore


# Singleton type, as per https://github.com/python/typing/pull/240
Expand Down

0 comments on commit cda1b26

Please sign in to comment.