feat: support zarr 3 - #237
Open
Marius1311 wants to merge 1 commit into
Open
Conversation
Removing the zarr<3 pin is not enough on its own: zarr 3 dropped attribute access to group members, so ZarrDataset needs a small adapter, and the vendored 2021-era copy of anndata's zarr writer uses the v2 creation API throughout. Delete that copy (250 lines) and write through anndata.io.write_elem instead. It is what anndata itself uses, it tracks the encoding versions the readers expect, and it removes the duplicated encoder entirely. Reads keep going through the caller's fsspec mapper, which zarr 3 still accepts. Writes take the path, because zarr creates the directories it writes into and an fsspec LocalFileSystem mapper does not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VYsKhgGuNCFtxqFhSLGtCK
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to #235. Removing the pin alone is not enough —
maindoes not run under zarr 3:zarr.hierarchyno longer exists, soZarrDataset.is_groupraises.dataset_schema(g)raisesAttributeError: 'Group' object has no attribute 'uns'. It is written that way because it also accepts a plainAnnData, hence the smallAttributeGroupadapter.anndata_zarr.pyis a vendored copy of anndata's zarr writer from ~2021 and uses the v2 creation API throughout.Rather than port that copy, this deletes it (250 lines) and writes through
anndata.io.write_elem— what anndata itself uses, and one less encoder to keep in step by hand.Reads still go through the caller's fsspec mapper, which zarr 3 still accepts. Writes take the path instead, since zarr creates the directories it writes into and an fsspec
LocalFileSystemmapper does not;get_fs()derives the filesystem from the path scheme, so this is equivalent.Note
requirements.txtonmainalready sayszarr==3.3.0whilepyproject.tomlsayszarr<3.Best reviewed after #233 and #236, which fix reader bugs zarr 3 exposes but does not cause.
🤖 Generated with Claude Code