-
-
Notifications
You must be signed in to change notification settings - Fork 328
[v3]: TypeError when updating Array.attrs, thanks to incorrect inferred fill_value #2153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Or maybe the issue is just that zarr-python v3 (and maybe the spec?) don't support this data type yet? Looking through the spec, I suppose we could support it with the |
As a short-term fix, I think we can update zarr-python/src/zarr/core/metadata.py Line 642 in e8800b0
bytes and str , not just str .
I do want to spend some type figuring out what the appropriate fill_value is for |
This is now erroring much earlier with a reasonable error: arr = zarr.open_array(store=store, path="a", shape=(), dtype=np.dtype("S6"))
ValueError: Invalid V3 data_type: |S6 |
This appears to have been fixed by #2036 |
There is another issue here, which is the fact that I can't figure out how to actually read arr[:]
|
👇
|
Zarr version
v3
Numcodecs version
n/a
Python Version
n/a
Operating System
n/a
Installation
v3
Description
Discovered while looking at the xarray unit tests for Zarr.
Steps to reproduce
The
.put
call raises withAdditional output
The
Array.update_attributes
call is a bit of a red herring. That just happens to go throughMetadata.__init__
, which validates the fill value for a given dtype. Only this type we usefill_value=np.bytes(b"")
, which is incompatible with the dtypenp.dtype("S6")
.So I think the shorter reproducer is something like
in other words, maybe(?) our inferred fill value is incorrect for this specific dtype.
The text was updated successfully, but these errors were encountered: