[optimize] Refactor BatchMeta to ordinary class#53
Conversation
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
CLA Signature Pass0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
There was a problem hiding this comment.
Pull request overview
This PR refactors BatchMeta from a @dataclass into a regular __slots__-based class and removes the previously-added serialization workaround that existed because msgspec auto-serialized dataclasses (bypassing enc_hook).
Changes:
- Convert
BatchMetato a regular class with__slots__and an explicit__init__performing normalization/validation. - Remove the BatchMeta-specific msgpack Ext serialization path in
serial_utils(and associated preprocessing). - Remove the
__setstate__-specific test coverage for the old dataclass deserialization path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
transfer_queue/utils/serial_utils.py |
Removes BatchMeta-specific Ext handling; adjusts msgpack custom type codes. |
transfer_queue/metadata.py |
Refactors BatchMeta into an ordinary class with __slots__ and explicit initialization/validation. |
tests/test_metadata.py |
Removes the __setstate__ read-only production_status regression test tied to the old dataclass behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
CLA Signature Pass0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
CLA Signature Pass0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BatchMetafrom@dataclassto regular classBatchMeta