Skip to content

Commit 6afdca3

Browse files
committed
Fix mode
1 parent 94f2584 commit 6afdca3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/pydantic_zarr/v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def to_zarr(
385385
if self.filters is not None:
386386
spec_dict["filters"] = [numcodecs.get_codec(f) for f in spec_dict["filters"]]
387387
if _contains_array(store, path):
388-
extant_array = zarr.open_array(store, path=path, mode="r", zarr_format=2)
388+
extant_array = zarr.open_array(store, path=path, zarr_format=2)
389389

390390
if not self.like(extant_array):
391391
if not overwrite:

tests/test_pydantic_zarr/test_v2.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,7 @@ def test_array_spec(
182182
assert ArraySpec.from_zarr(stored_2) == spec_2
183183

184184
# test that mode and write_empty_chunks get passed through
185-
assert spec_2.to_zarr(store, path="foo", mode="a").read_only is False
186-
# TODO: uncomment line below when https://github.com/zarr-developers/zarr-python/issues/2949 is fixed
187-
# assert spec_2.to_zarr(store, path="foo", mode="r").read_only is True
185+
assert spec_2.to_zarr(store, path="foo").read_only is False
188186
# TODO: work out if there's a way to get the status of "write_empty_chunks" from an array
189187
"""
190188
assert (

0 commit comments

Comments
 (0)