Read and write icechunk sessions through the zarr-python Store instead of linking the icechunk crate
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with src/storage/async.rs and the current PyAsyncIcechunkStore, then run the existing icechunk tests in tests/test_icechunk.py. Prototype the generic async Store adapter for the listed operations, benchmark full-array and sharded partial reads, and add tests showing zarrista writes can be committed and read back through the session.
Written by the indexing model from the issue text.
Description
[!NOTE]
This issue was written by Claude (Claude Code, Opus 5), not by @kylebarron.
Problem
Writes through an icechunk Session are lost (#187). This is the concern raised in #107.
zarrista cannot share a Rust object with the separately compiled icechunk Python package. So PyAsyncIcechunkStore serializes the Python session (the private _session.as_bytes()) and rebuilds a second icechunk::session::Session in Rust (src/storage/async.rs). All writes go into the change set of that copy. Nothing copies the change set back, so:
session.has_uncommitted_changesstaysFalse, andsession.commit()raisesSessionStateError: no changes made to the session.- Each extraction builds a new copy.
AsyncArray.open(session, "/arr")afterbuilder.create_async(session, "/arr")fails witharray metadata is missing. - A
ForkSessionis rejected withTypeError, becauseis_icechunk_sessionchecks for the exact class nameSession.
Merging the Rust copy back (serialize it, wrap it in a ForkSession, call session.merge) works in a quick test, but it adds more to the private-API, two-instance design instead of removing it.
Proposal
Read and write through the public zarr-python Store (session.store) instead of linking the icechunk crate. Implement this as a generic Rust adapter over any zarr-python async Store, not an icechunk-specific one.
Benefits:
- One session and one change set. Writes appear in
session, andcommitworks. - No private API. No reconstructed second icechunk instance.
- No version coupling. The icechunk major-version check and the
icechunk>=2/ Python 3.12 split inpyproject.tomlare no longer needed. icechunk.in_memory_storage()sessions work.- The
icechunkandzarrs_icechunkcrates leave theasyncfeature. This reduces compile time and wheel size. - Other zarr-python stores also work.
Costs and risks:
- Each store operation goes through Python: take the GIL, schedule a coroutine on the asyncio event loop, and wait. Decoding stays parallel in Rust, but all I/O dispatch goes through one event loop. This can matter for many small keys, such as sharded partial reads.
- The public icechunk store copies data on
get(prototype.buffer.from_bytes) and onset(value.to_bytes()). - zarrs calls the store from tokio threads. The adapter must capture
TaskLocalswhen a call starts and convert Python coroutines withpyo3_async_runtimes::into_future_with_locals.
Plan
- Prototype the adapter with
get,get_partial_values,set,delete,list, andlist_dir. - Benchmark reads against the current linked-crate path. Use local storage, a full-array read, and a sharded partial read.
- If the overhead is acceptable, replace
PyAsyncIcechunkStorewith the adapter for reads and writes, and remove theicechunkandzarrs_icechunkdependencies. - If read overhead is too large, consider the linked crate for read-only sessions only (a copy of a read-only session is safe) and the adapter for writable sessions. Avoid this unless the numbers require it, because it keeps two code paths.
- Add write tests to
tests/test_icechunk.py: create and write with zarrista, commit, and read back. Today the tests write with zarr-python and only read with zarrista, so they did not catch #187.
Closes #187. Resolves #107.
🤖 Written by Claude Code
- Dominant language
- Python
- Stars
- 52
- Forks
- 3
- Avg merge
- 36m
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/zarrista
-
Difficulty 4/5 3-5 days Newbie friendliness 54/100
developmentseed/zarrista#222 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
developmentseed/zarrista#211 · 1 comment ·
-
Bump to arrow 60Open
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
developmentseed/zarrista#203 ·
-
pyemscripten wheel is unimportable: the Python layer imports async-only classes unconditionallyOpen
Difficulty 3/5 1-2 days Newbie friendliness 57/100
developmentseed/zarrista#189 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
developmentseed/zarrista#187 · 1 comment ·
All issues in developmentseed/zarrista
Similar issues
-
00 - Bug component: numpy.linalg
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
521xueweihan/HelloGitHub#4543 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
emeryberger/CSrankings#15700 ·
Maintainers usually reply within 2 days
-
Bug | 工作不正常 Triage | 待检查
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
Maintainers usually reply within 1 day
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day