Skip to content

Commit 95348d6

Browse files
committed
ensure that we accept dict form of compressor in _parse_chunk_encoding_v2
1 parent 77f40a5 commit 95348d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/zarr/core/array.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,8 +3780,9 @@ def _parse_chunk_encoding_v2(
37803780
if compressor == "auto":
37813781
_compressor = default_compressor
37823782
else:
3783-
if isinstance(compressor, Iterable):
3784-
raise TypeError("For Zarr v2 arrays, the `compressor` must be a single codec.")
3783+
if isinstance(compressor, Iterable) and not isinstance(compressor, dict):
3784+
msg = f"For Zarr v2 arrays, the `compressor` must be a single codec. Got an iterable with type {type(compressor)} instead."
3785+
raise TypeError(msg)
37853786
_compressor = parse_compressor(compressor)
37863787
if filters == "auto":
37873788
_filters = default_filters

0 commit comments

Comments
 (0)