Skip to content

feat(array): report the chunk shapes a write would be refused for - #438

Draft
d-v-b wants to merge 1 commit into
fix/codec-chain-validationfrom
feat/check-write-chunks
Draft

d-v-b wants to merge 1 commit into
fix/codec-chain-validationfrom
feat/check-write-chunks

Conversation

@d-v-b

@d-v-b d-v-b commented Nov 3, 2026

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

Add Array.validate_write and AsyncArray.validate_write, which report the chunk shapes in a selection that the array's codecs reject, without writing anything or doing any I/O. They take any selection Array.__setitem__ takes and return one zarr.types.ChunkProblem per rejected chunk shape, naming the kind of problem, the shape, the first selected chunk with that shape, and the codec that rejected it. Only an array whose codecs were validated against a single representative chunk can have problems here; that requires a rectilinear chunk grid, which is experimental, and a codec that does not declare how it changes the grid.

An empty result covers codec validation only: a codec that checks a shape only while encoding passes it, the store may be read-only, and unknown field names are not looked up.

Stack

Stacked on zarr-developers#4352 (fix/codec-chain-validation, ae8ddb181); merge that first. _check_chunks_before_write now shares its chunk enumeration with this method. The changelog fragment carries this fork PR's number and needs renaming if the change lands through a different PR.

🤖 Generated with Claude Code

Array.validate_write takes any selection __setitem__ takes and returns one
ChunkProblem per chunk shape the codec chain rejects, without writing or doing
any I/O. A basic selection is checked per distinct shape rather than per chunk,
and the check before a chunk-local write shares that enumeration.

Assisted-by: ClaudeCode:claude-opus-5-5
@d-v-b
d-v-b force-pushed the feat/check-write-chunks branch from f23d84b to c46e6ef Compare November 3, 2026 17:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant