Skip to content

Commit e2d4df8

Browse files
committed
fix broken tests that used invalid codec JSON
1 parent cbb32d7 commit e2d4df8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

tests/test_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,8 +1105,8 @@ def test_dtype_roundtrip(
11051105
(ZstdCodec(level=3),),
11061106
(ZstdCodec(level=3), GzipCodec(level=0)),
11071107
ZstdCodec(level=3),
1108-
{"name": "zstd", "configuration": {"level": 3}},
1109-
({"name": "zstd", "configuration": {"level": 3}},),
1108+
{"name": "zstd", "configuration": {"level": 3, "checksum": True}},
1109+
({"name": "zstd", "configuration": {"level": 3, "checksum": True}},),
11101110
],
11111111
)
11121112
@pytest.mark.parametrize(

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def _encode_single(self, chunk_bytes: Buffer, chunk_spec: ArraySpec) -> Bu
180180
chunks=(10,),
181181
zarr_format=3,
182182
dtype="i4",
183-
compressors=[{"name": "blosc", "configuration": {}}],
183+
compressors=[{"name": "blosc", "configuration": {"cname": "lz4", "clevel": 1, "shuffle": "noshuffle", "blocksize": 1, "typesize": 1}},],
184184
)
185185
arr[:] = range(100)
186186
_mock.call.assert_called()

tests/test_group.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import zarr
1717
import zarr.api.asynchronous
1818
import zarr.api.synchronous
19+
from zarr.core.array import default_compressor_v2, default_compressors_v3, default_serializer_v3
1920
import zarr.storage
2021
from zarr import Array, AsyncArray, AsyncGroup, Group
2122
from zarr.abc.store import Store
@@ -523,7 +524,7 @@ def test_group_child_iterators(store: Store, zarr_format: ZarrFormat, consolidat
523524
"chunks": (1,),
524525
"order": "C",
525526
"filters": None,
526-
"compressor": Blosc(),
527+
"compressor": default_compressor_v2(dtype).to_json(zarr_format=zarr_format),
527528
"zarr_format": zarr_format,
528529
},
529530
"subgroup": {
@@ -550,8 +551,11 @@ def test_group_child_iterators(store: Store, zarr_format: ZarrFormat, consolidat
550551
"name": "default",
551552
},
552553
"codecs": (
553-
{"configuration": {"endian": "little"}, "name": "bytes"},
554-
{"configuration": {}, "name": "zstd"},
554+
default_serializer_v3(dtype).to_json(zarr_format=zarr_format),
555+
*[
556+
c.to_json(zarr_format=zarr_format)
557+
for c in default_compressors_v3(dtype)
558+
],
555559
),
556560
"data_type": unpack_dtype_json(dtype.to_json(zarr_format=zarr_format)),
557561
"fill_value": fill_value,

0 commit comments

Comments
 (0)