Skip to content

Commit 740118c

Browse files
committed
fixes for passing tests
1 parent ee677f9 commit 740118c

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/zarr/api/synchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def create_array(
754754
data: np.ndarray[Any, np.dtype[Any]] | None = None,
755755
chunks: ChunkCoords | Literal["auto"] = "auto",
756756
shards: ShardsLike | None = None,
757-
filters: Iterable[FilterLike] | None | Literal["auto"] = "auto",
757+
filters: FilterLike | Iterable[FilterLike] | None | Literal["auto"] = "auto",
758758
compressors: CompressorLike | Iterable[CompressorLike] | None | Literal["auto"] = "auto",
759759
serializer: SerializerLike | Literal["auto"] = "auto",
760760
fill_value: Any | None = DEFAULT_FILL_VALUE,

src/zarr/core/array.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ async def create_array(
43384338
chunks: ChunkCoords | Literal["auto"] = "auto",
43394339
shards: ShardsLike | None = None,
43404340
filters: FilterLike | Iterable[FilterLike] | None | Literal["auto"] = "auto",
4341-
compressors: Iterable[CompressorLike] | CompressorLike | None | Literal["auto"] = "auto",
4341+
compressors: CompressorLike | Iterable[CompressorLike] | None | Literal["auto"] = "auto",
43424342
serializer: SerializerLike | Literal["auto"] = "auto",
43434343
fill_value: Any | None = DEFAULT_FILL_VALUE,
43444344
order: MemoryOrder | None = None,
@@ -4870,6 +4870,9 @@ def _parse_deprecated_compressor(
48704870
compressors = ()
48714871
else:
48724872
compressors = (compressor,)
4873+
# TODO: remove this, because we should be setting the default deeper in the stack
4874+
elif zarr_format == 2 and compressor == compressors == "auto":
4875+
compressors = ({"id": "blosc"},)
48734876
return compressors
48744877

48754878

src/zarr/core/metadata/v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ def parse_filters(data: object) -> tuple[Numcodec, ...] | None:
275275
for val in data:
276276
if _is_numcodec(val):
277277
out.append(val)
278-
if _check_codecjson_v2(val):
278+
elif _check_codecjson_v2(val):
279279
out.append(get_numcodec(val))
280280
else:
281-
msg = f'Invalid representation of Numcodec. Got {data}, expected a dict with an "id" key or a Numcodec instance.'
281+
msg = f'Invalid representation of a Zarr V2 codec. Got {data}, expected a dict with an "id" key or a Numcodec instance.'
282282
raise TypeError(msg)
283283
if len(out) == 0:
284284
# Per the v2 spec, an empty tuple is not allowed -- use None to express "no filters"

0 commit comments

Comments
 (0)