From e4ad5796f3fb54920199302aa3c9ebe1815f9222 Mon Sep 17 00:00:00 2001 From: Mathieu Scheltienne Date: Mon, 12 Jan 2026 11:44:50 +0100 Subject: [PATCH 1/2] fix deprecation --- src/zarr/codecs/vlen_utf8.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zarr/codecs/vlen_utf8.py b/src/zarr/codecs/vlen_utf8.py index fa1a229855..d8e6072333 100644 --- a/src/zarr/codecs/vlen_utf8.py +++ b/src/zarr/codecs/vlen_utf8.py @@ -50,7 +50,7 @@ async def _decode_single( raw_bytes = chunk_bytes.as_array_like() decoded = _vlen_utf8_codec.decode(raw_bytes) assert decoded.dtype == np.object_ - decoded.shape = chunk_spec.shape + decoded = decoded.reshape(chunk_spec.shape) as_string_dtype = decoded.astype(chunk_spec.dtype.to_native_dtype(), copy=False) return chunk_spec.prototype.nd_buffer.from_numpy_array(as_string_dtype) @@ -95,7 +95,7 @@ async def _decode_single( raw_bytes = chunk_bytes.as_array_like() decoded = _vlen_bytes_codec.decode(raw_bytes) assert decoded.dtype == np.object_ - decoded.shape = chunk_spec.shape + decoded = decoded.reshape(chunk_spec.shape) return chunk_spec.prototype.nd_buffer.from_numpy_array(decoded) async def _encode_single( From 2bc0cbc2d63ff600325d3dde9661cf729a83a217 Mon Sep 17 00:00:00 2001 From: Mathieu Scheltienne Date: Mon, 12 Jan 2026 11:46:42 +0100 Subject: [PATCH 2/2] add changelog entry --- changes/3648.misc.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/3648.misc.md diff --git a/changes/3648.misc.md b/changes/3648.misc.md new file mode 100644 index 0000000000..156f8671de --- /dev/null +++ b/changes/3648.misc.md @@ -0,0 +1 @@ +Fix deprecation of setting a shape on an array directly in ``numpy`` 2.5+.