Skip to content

Commit e62775d

Browse files
committed
fix failing tests
1 parent 62b198e commit e62775d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/zarr/core/metadata/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def save_metadata(
5555
metadata : ArrayMetadata | GroupMetadata
5656
Metadata to save.
5757
ensure_parents : bool, optional
58-
Whether to create any missing parent groups
58+
Create any missing parent groups, and check no existing parents are arrays.
5959
6060
Raises
6161
------

tests/test_indexing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,14 +2042,14 @@ async def test_async_oindex(self, store, indexer, expected):
20422042

20432043
@pytest.mark.asyncio
20442044
async def test_async_oindex_with_zarr_array(self, store):
2045-
z1 = zarr.create_array(store=store, shape=(2, 2), chunks=(1, 1), zarr_format=3, dtype="i8")
2045+
group = zarr.create_group(store=store, zarr_format=3)
2046+
2047+
z1 = group.create_array(name="z1", shape=(2, 2), chunks=(1, 1), dtype="i8")
20462048
z1[...] = np.array([[1, 2], [3, 4]])
20472049
async_zarr = z1._async_array
20482050

20492051
# create boolean zarr array to index with
2050-
z2 = zarr.create_array(
2051-
store=store, name="z2", shape=(2,), chunks=(1,), zarr_format=3, dtype="?"
2052-
)
2052+
z2 = group.create_array(name="z2", shape=(2,), chunks=(1,), dtype="?")
20532053
z2[...] = np.array([True, False])
20542054

20552055
result = await async_zarr.oindex.getitem(z2)
@@ -2075,14 +2075,14 @@ async def test_async_vindex(self, store, indexer, expected):
20752075

20762076
@pytest.mark.asyncio
20772077
async def test_async_vindex_with_zarr_array(self, store):
2078-
z1 = zarr.create_array(store=store, shape=(2, 2), chunks=(1, 1), zarr_format=3, dtype="i8")
2078+
group = zarr.create_group(store=store, zarr_format=3)
2079+
2080+
z1 = group.create_array(name="z1", shape=(2, 2), chunks=(1, 1), dtype="i8")
20792081
z1[...] = np.array([[1, 2], [3, 4]])
20802082
async_zarr = z1._async_array
20812083

20822084
# create boolean zarr array to index with
2083-
z2 = zarr.create_array(
2084-
store=store, name="z2", shape=(2, 2), chunks=(1, 1), zarr_format=3, dtype="?"
2085-
)
2085+
z2 = group.create_array(name="z2", shape=(2, 2), chunks=(1, 1), dtype="?")
20862086
z2[...] = np.array([[False, True], [False, True]])
20872087

20882088
result = await async_zarr.vindex.getitem(z2)

0 commit comments

Comments
 (0)