Skip to content

[optimize] Refactor BatchMeta to ordinary class#53

Merged
0oshowero0 merged 3 commits intoAscend:mainfrom
0oshowero0:batchmeta
Mar 20, 2026
Merged

[optimize] Refactor BatchMeta to ordinary class#53
0oshowero0 merged 3 commits intoAscend:mainfrom
0oshowero0:batchmeta

Conversation

@0oshowero0
Copy link
Copy Markdown
Collaborator

  1. Refactor BatchMeta from @dataclass to regular class
  2. Remove unnecessary serialization fix for dataclass BatchMeta

Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Copilot AI review requested due to automatic review settings March 20, 2026 03:39
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BatchMeta to 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>
@0oshowero0 0oshowero0 requested a review from Copilot March 20, 2026 04:34
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@0oshowero0 0oshowero0 merged commit 5f303c3 into Ascend:main Mar 20, 2026
9 checks passed
@0oshowero0 0oshowero0 deleted the batchmeta branch April 2, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants