Skip to content

deps: bump cast-value.rs to >= 0.4.2 - #4260

Open
d-v-b wants to merge 5 commits into
zarr-developers:mainfrom
d-v-b:bump-cast-value
Open

deps: bump cast-value.rs to >= 0.4.2#4260
d-v-b wants to merge 5 commits into
zarr-developers:mainfrom
d-v-b:bump-cast-value

Conversation

@d-v-b

@d-v-b d-v-b commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

closes #4237 by updating cast-value.rs. The underlying issue was fixed in zarr-developers/cast-value.rs#28.

I did this by hand.

For reviewers

I'm going to self-merge this when green because it's fixing a data corruption issue.

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Aug 13, 2026
@d-v-b
d-v-b marked this pull request as ready for review August 13, 2026 10:17
d-v-b and others added 4 commits August 13, 2026 16:15
The pyproject floor alone left uv.lock pinning 0.4.0, so any
lock-honoring install (uv sync --locked/--frozen) kept the version
that silently transposes non-row-major input.

Assisted-by: ClaudeCode:claude-fable-5
The pyproject floor only binds installs that go through the
zarr[cast-value-rs] extra. An environment that already has an older
cast-value-rs installed kept silently corrupting non-row-major input
after upgrading zarr, which is the failure this floor exists to stop.

Check the installed version at import and raise from _do_cast, so the
error surfaces when the codec is used rather than breaking `import zarr`
for everyone else. A backend without distribution metadata (a `maturin
develop` build) has no version to compare and is left alone.

Assisted-by: ClaudeCode:claude-fable-5
Regression test for zarr-developers#4237: a cast_value codec on either side of a
transpose codec must round-trip, because transpose hands the next codec
a non-row-major view.

Imported unchanged from zarr-developers#4238, where this test was written. The
np.ascontiguousarray workaround that accompanied it there is
deliberately left out: cast-value-rs 0.4.2 normalizes layout itself, and
the workaround promotes 0-d arrays to shape (1,), breaking 0-d arrays.

Co-authored-by: Raphael Jolivet <raphael.jolivet@minesparis.psl.eu>
Assisted-by: ClaudeCode:claude-fable-5
@github-actions github-actions Bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (4aba691) to head (78ee7db).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4260      +/-   ##
==========================================
+ Coverage   94.00%   94.01%   +0.01%     
==========================================
  Files          91       91              
  Lines       12795    12808      +13     
==========================================
+ Hits        12028    12042      +14     
+ Misses        767      766       -1     
Files with missing lines Coverage Δ
src/zarr/codecs/cast_value.py 99.35% <100.00%> (+0.75%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

"ValueError: Input array must be contiguous" when *cast_value* codec next to *transpose* codec

2 participants