Repository navigation
fix: accept lists of byte values as fill values for byte dtypes - #4493
Open
barlowa124 wants to merge 3 commits into
Open
barlowa124 wants to merge 3 commits into
barlowa124 wants to merge 3 commits into
Conversation
barlowa124
added a commit
to barlowa124/zarr-python
that referenced
this pull request
Oct 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4493 +/- ##
=======================================
Coverage 94.90% 94.90%
=======================================
Files 96 96
Lines 14048 14056 +8
=======================================
+ Hits 13332 13340 +8
Misses 716 716
🚀 New features to boost your workflow:
|
barlowa124
added a commit
to barlowa124/zarr-python
that referenced
this pull request
Nov 11, 2026
barlowa124
force-pushed
the
bytes-fill-array-4453
branch
from
November 11, 2026 05:39
4d09a43 to
52c3dc9
Compare
The Zarr V3 spec allows fill values for byte data types to be given either as a base64-encoded string or as an array of byte values, but from_json_scalar only accepted the string form. NullTerminatedBytes, RawBytes, and VariableLengthBytes now accept a JSON list of integers in [0, 255] and reject non-byte elements with a clear TypeError. Refs zarr-developers#4453 Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
barlowa124
force-pushed
the
bytes-fill-array-4453
branch
from
November 12, 2026 20:00
52c3dc9 to
0de8979
Compare
This branch has not been deployed
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.
Summary
Refs #4453, fourth checklist item. A
fill_valueon a byte data typemust be written as a base64 string today, though the Zarr V3 spec also
permits a list of byte values.
from_json_scalaronNullTerminatedBytes,RawBytesandVariableLengthBytesrejectedthat form, so a spec-valid
fill_value: [65]raisedTypeError.The new
check_json_byte_listinnpy/common.pymatches a JSON listof integers 0 through 255, booleans excluded. All three byte dtypes
accept the form and convert through
bytes(...). Anything else fallsthrough to the existing
TypeError, whose message now names bothaccepted forms.
For reviewers
Open question: should a byte list longer than the fixed length be
rejected rather than truncated by
np.bytes_/np.void? Silenttruncation is kept because the base64 path already behaves that way,
keeping the two forms consistent.
Author attestation
TODO
Done:
changes/Outstanding:
docs/user-guide/*.md