refactor(python): refactor python serialization api#3543
Merged
chaokunyang merged 8 commits intoapache:mainfrom Apr 8, 2026
Merged
refactor(python): refactor python serialization api#3543chaokunyang merged 8 commits intoapache:mainfrom
chaokunyang merged 8 commits intoapache:mainfrom
Conversation
pandalee99
approved these changes
Apr 7, 2026
3084dc3 to
afb0bde
Compare
e9a1e03 to
3147136
Compare
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.
Why?
Refactor the Python serialization runtime to make serializer ownership and per-operation state explicit. This moves read and write state out of
Fory, aligns the Python and Cython code paths around the same context model, and simplifies how custom serializers interact with the runtime.What does this PR do?
Config,WriteContext, andReadContextruntime objects and moves serialization state management out ofFory.type_resolverin constructors and to read or write throughread_contextandwrite_contextinstead of raw buffer methods.context.pyandcontext.pxi, slimmingserialization.pyx, and wiring collection, primitive, struct, union, and registry paths through the new boundaries.Related issues
#3537
AI Contribution Checklist
yes/noyes, I included a completed AI Contribution Checklist in this PR description and the requiredAI Usage Disclosure.Does this PR introduce any user-facing change?
This refactor changes the Python custom serializer constructor and read or write method signatures, and updates the Python docs accordingly.
Benchmark