Minimal example:
importzarra=zarr.create((1,), dtype=bytes)
a[0] =b''asserta[0] ==b''Traceback (mostrecentcalllast):
File"example.py", line5, in<module>asserta[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.
Minimal example:
The value of
a[0]is actually0, when it should beb''.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 forwrite_empty_chunkswas changed toFalse. The defaultfill_valuefor arrays created viazarr.creation.createis0, so when an empty, unwritten chunk is re-created the previous valueb''becomes0. I assume thisfill_valueshould beNone.