Skip to content

Commit 07ce115

Browse files
committed
tweak
1 parent 8de93cb commit 07ce115

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
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

0 commit comments

Comments
 (0)