Skip to content

Commit b2aa207

Browse files
committed
fix serializer from_array v2 to v3
1 parent c8c7b57 commit b2aa207

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/zarr/core/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3992,7 +3992,7 @@ async def from_array(
39923992
else:
39933993
compressors = "auto"
39943994
if serializer == "keep":
3995-
if zarr_format == 3:
3995+
if zarr_format == 3 and data.metadata.zarr_format == 3:
39963996
serializer = cast(SerializerLike, data.serializer)
39973997
else:
39983998
serializer = "auto"

tests/test_array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,7 @@ async def test_creation_from_other_zarr_format(
13651365
assert result.fill_value == src.fill_value
13661366
assert result.dtype == src.dtype
13671367
assert result.chunks == src.chunks
1368+
assert result.metadata.zarr_format == new_format
13681369
if src_format == new_format:
13691370
assert result.metadata == src.metadata
13701371

0 commit comments

Comments
 (0)