Skip to content

Restore -1 Zarr chunk sentinel handling#11291

Open
officialasishkumar wants to merge 1 commit intopydata:mainfrom
officialasishkumar:fix-11288-zarr-negative-chunks
Open

Restore -1 Zarr chunk sentinel handling#11291
officialasishkumar wants to merge 1 commit intopydata:mainfrom
officialasishkumar:fix-11288-zarr-negative-chunks

Conversation

@officialasishkumar
Copy link
Copy Markdown

Description

Dataset.to_zarr and DataArray.to_zarr document -1 as a way to request a full-dimension chunk in the encoding. With zarr v3, passing that sentinel through unchanged now fails because zarr requires non-negative chunk sizes.

This normalizes -1 to the written dimension length before passing chunk metadata to zarr, preserving the documented behavior and the legacy zarr v2-compatible workflow.

Checklist

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Codex

Translate xarray's documented -1 chunk sentinel into explicit full-dimension chunk sizes before passing chunk metadata to zarr, and cover the regression with a roundtrip test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io topic-backends topic-zarr Related to zarr storage library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative chunks break in newer version

1 participant