-
-
Notifications
You must be signed in to change notification settings - Fork 327
Fix nan encoding in consolidated metadata #2996
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
Fix nan encoding in consolidated metadata #2996
Conversation
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if something like #2144 would mean we don't need this workaround, but this looks good for now.
* Fix nan encoding in consolidated metadata Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
@@ -355,10 +355,10 @@ def to_buffer_dict(self, prototype: BufferPrototype) -> dict[str, Buffer]: | |||
assert isinstance(consolidated_metadata, dict) | |||
for k, v in consolidated_metadata.items(): | |||
attrs = v.pop("attributes", None) | |||
d[f"{k}/{ZATTRS_JSON}"] = attrs | |||
d[f"{k}/{ZATTRS_JSON}"] = _replace_special_floats(attrs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpiannucci was this particular change important? Given that the "special floats" logic is very narrowly scoped to array metadata, I don't think we want to apply it to the attributes.
I'm just seeing this now as I adapt #2874 to the latest changes.
Fixes #2990 by reusing the special character replacement before encoding the same as the v3 metadata does
TODO:
docs/user-guide/*.rst
changes/