Skip to content

Commit e838999

Browse files
committed
tweak
1 parent 8de93cb commit e838999

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

xarray/backends/zarr.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import struct
77
from collections.abc import Hashable, Iterable, Mapping
8-
from typing import TYPE_CHECKING, Any, Literal
8+
from typing import TYPE_CHECKING, Any, Literal, cast
99

1010
import numpy as np
1111
import pandas as pd
@@ -1066,9 +1066,7 @@ def _open_existing_array(self, *, name) -> ZarrArray:
10661066
else:
10671067
zarr_array = self.zarr_group[name]
10681068

1069-
if TYPE_CHECKING:
1070-
assert isinstance(zarr_array, ZarrArray)
1071-
return zarr_array
1069+
return cast(ZarrArray, zarr_array)
10721070

10731071
def _create_new_array(
10741072
self, *, name, shape, dtype, fill_value, encoding, attrs

xarray/core/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from zarr.storage import StoreLike as ZarrStoreLike
7474
except ImportError:
7575
ZarrArray = np.ndarray # type: ignore[misc, assignment, unused-ignore]
76-
ZarrStoreLike = Any # type: ignore[misc]
76+
ZarrStoreLike = Any # type: ignore[misc, assignment, unused-ignore]
7777

7878
# Anything that can be coerced to a shape tuple
7979
_ShapeLike = Union[SupportsIndex, Sequence[SupportsIndex]]

0 commit comments

Comments
 (0)