Skip to content

Commit c01506f

Browse files
committed
fix typing
1 parent d090fe6 commit c01506f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from zarr.abc.store import Store
1212
from zarr.core.array import Array, AsyncArray, get_array_metadata
13+
from zarr.core.buffer import NDArrayLike
1314
from zarr.core.common import (
1415
JSON,
1516
AccessModeLiteral,
@@ -31,7 +32,6 @@
3132
from collections.abc import Iterable
3233

3334
from zarr.abc.codec import Codec
34-
from zarr.core.buffer import NDArrayLike
3535
from zarr.core.chunk_key_encodings import ChunkKeyEncoding
3636

3737
# TODO: this type could use some more thought

tests/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,18 @@ async def test_open_group_unspecified_version(
139139
def test_save(store: Store, n_args: int, n_kwargs: int) -> None:
140140
data = np.arange(10)
141141
data = cast(NDArrayLike, data)
142+
args = [np.arange(10) for _ in range(n_args)]
143+
kwargs = {f"arg_{i}": data for i in range(n_kwargs)}
142144

143145
if n_kwargs == 0 and n_args == 0:
144146
with pytest.raises(ValueError):
145147
save(store)
146148
elif n_args == 1 and n_kwargs == 0:
147-
save(store, data)
149+
save(store, *args)
148150
array = open(store)
149151
assert isinstance(array, Array)
150-
assert_array_equal(array, data)
152+
assert_array_equal(array[:], data)
151153
else:
152-
args = [np.arange(10) for _ in range(n_args)]
153-
kwargs = {f"arg_{i}": data for i in range(n_kwargs)}
154154
save(store, *args, **kwargs)
155155
group = open(store)
156156
assert isinstance(group, Group)

0 commit comments

Comments
 (0)