Skip to content

Commit

Permalink
(fix): string dtype test to match zarr-python
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-gold committed Feb 4, 2025
1 parent 9a0daa9 commit 4637d24
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,11 @@ def test_v2_encode_decode_with_data(dtype_value, tmp_path):


@pytest.mark.parametrize("dtype", [str, "str"])
async def test_create_dtype_str(dtype: Any, tmp_path: Path) -> None:
arr = zarr.create(
store=tmp_path,
shape=3,
dtype=dtype,
zarr_format=2,
# https://github.com/zarr-developers/zarr-python/issues/2627
filters=zarr.codecs.vlen_utf8.VLenUTF8(),
)
async def test_create_dtype_str(dtype: Any, tmp_path) -> None:
arr = zarr.create(store=tmp_path, shape=3, dtype=dtype, zarr_format=2)
assert arr.dtype.kind == "O"
assert arr.metadata.to_dict()["dtype"] == "|O"
assert arr.metadata.filters == (zarr.codecs.vlen_utf8.VLenUTF8(),)
assert arr.metadata.filters == (numcodecs.vlen.VLenBytes(),)
arr[:] = [b"a", b"bb", b"ccc"]
result = arr[:]
np.testing.assert_array_equal(
Expand Down

0 comments on commit 4637d24

Please sign in to comment.