fix: handle numpy arrays nested in dicts/lists for auto serializer#52
Closed
fix: handle numpy arrays nested in dicts/lists for auto serializer#52
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- bytes 1.10.1 → 1.11.1 (RUSTSEC-2026-0007: integer overflow in BytesMut::reserve) - filelock 3.20.1 → 3.24.3 (GHSA-qmgc-5h2g-mvrw: TOCTOU symlink vuln) - orjson 3.11.4 → 3.11.7 (GHSA-hx9q-6w63-j58v: unbounded recursion) - pip 25.3 → 26.0.1 (GHSA-6vgw-5pg2-w6jp: path traversal in wheel extraction) - test_ttl_enforced: increase TTL 1s→3s to prevent CI timing flakiness
_auto_default() had no handler for ndarray, so msgpack.packb() raised TypeError when traversing container types with nested numpy arrays. Added __ndarray__ marker to _auto_default/_auto_object_hook for roundtrip serialization of nested arrays via the msgpack fallback path. Closes #50
5d36d78 to
6a8c744
Compare
Contributor
Author
|
Superseded by combined fix PR |
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
serializer="auto"only handled top-level ndarray; nested arrays in dicts/lists hit_auto_default()which had no numpy handler, raisingTypeError__ndarray__marker to_auto_default()and corresponding deserialization in_auto_object_hook()for roundtrip supportTest plan
__ndarray__markers raiseSerializationErrorCloses #50