Skip to content

Commit b666d04

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents 752d1de + 85890b3 commit b666d04

5 files changed

Lines changed: 32 additions & 11 deletions

File tree

changes/3938.bugfix.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

changes/3941.bugfix.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/release-notes.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
<!-- towncrier release notes start -->
44

5+
## 3.2.1 (2026-05-05)
6+
7+
### Bugfixes
8+
9+
- Fixed a `CastValue` validation bug where the "can we use an out-of-range mode" check
10+
inspected the source dtype instead of the target dtype. This meant arrays with a
11+
float source dtype and an integer target dtype incorrectly raised a `ValueError`
12+
when configured with a `wrap` out-of-range mode. ([#3938](https://github.com/zarr-developers/zarr-python/issues/3938))
13+
- Fixed a bug where the codec pipeline evolved each codec against the original
14+
array spec instead of the spec produced by upstream array-to-array codecs. This
15+
caused failures whenever an upstream codec changed the dtype between codec
16+
boundaries — e.g. arrays using `CastValue` to convert a single-byte source dtype
17+
(`int8`) to a multi-byte target dtype (`int16`) raised a `ValueError` from
18+
`BytesCodec` about a missing `endian` configuration. ([#3941](https://github.com/zarr-developers/zarr-python/issues/3941))
19+
- Fixed breakage in existing fsspec-dependent workflows caused by associating the "memory" URL scheme with
20+
instances of `ManagedMemoryStore` instead of fsspec's memory-backed store. After this change, store URLs with a "memory" scheme are handled differently when `fsspec` is installed:
21+
with `fsspec`, a `FsspecStore` backed by a `MemoryFileSystem` is used. Without `fsspec`,
22+
a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr-python/issues/3944))
23+
524
## 3.2.0 (2026-04-30)
625

726
### Features

src/zarr/storage/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ async def make_store(
369369
return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only)
370370

371371
elif isinstance(store_like, str) and parsed is not None:
372-
if parsed.scheme == "memory":
372+
if parsed.scheme == "memory" and not _has_fsspec:
373373
# Create or get a ManagedMemoryStore
374374
return ManagedMemoryStore(name=parsed.name, path=parsed.path, read_only=_read_only)
375375
elif parsed.scheme == "file" or not parsed.scheme:

tests/test_store/test_fsspec.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from zarr.core.sync import _collect_aiterator, sync
1717
from zarr.errors import ZarrUserWarning
1818
from zarr.storage import FsspecStore
19+
from zarr.storage._common import make_store
1920
from zarr.storage._fsspec import _make_async
2021
from zarr.testing.store import StoreTests
2122

@@ -544,3 +545,14 @@ async def test_with_read_only_auto_mkdir(tmp_path: Path) -> None:
544545

545546
store_w = FsspecStore.from_url(f"file://{tmp_path}", storage_options={"auto_mkdir": False})
546547
_ = store_w.with_read_only()
548+
549+
550+
@pytest.mark.skipif(
551+
parse_version(fsspec.__version__) < parse_version("2024.12.0"),
552+
reason="No AsyncFileSystemWrapper",
553+
)
554+
async def test_memory_scheme() -> None:
555+
"""Test that the "memory" scheme creates a `MemoryFileSystem`-backed store"""
556+
store = await make_store("memory://test")
557+
assert isinstance(store, FsspecStore)
558+
assert store.fs.protocol == "memory"

0 commit comments

Comments
 (0)