Closed
Description
Minimal example:
import zarr
a = zarr.create((1,), dtype=bytes)
a[0] = b''
assert a[0] == b''
Traceback (most recent call last):
File "example.py", line 5, in <module>
assert a[0] == b''
AssertionError
The value of a[0]
is actually 0
, when it should be b''
.
Found by one of our users at tskit-dev/tsinfer#628 this bug was introduced in the latest release (v2.11.0
) in this commit: f461eb7 when the default for write_empty_chunks
was changed to False
. The default fill_value
for arrays created via zarr.creation.create
is 0
, so when an empty, unwritten chunk is re-created the previous value b''
becomes 0
. I assume this fill_value
should be None
.
Metadata
Metadata
Assignees
Labels
No labels