feat(#868k5bbdr): Add pickle-safe enum + pydantic-core schema validation#9
Merged
Conversation
loopingrage
approved these changes
Jul 7, 2026
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.
Cherry-picks the two behavioral patches that make the mapped/betterproto Python package a drop-in replacement for the
jbkoh/python-betterproto@844ab9dgit URL that mappedgpt-bot / mapped2 currently pin.Without these, generated pydantic models silently fall back to plain
int_schema(losing enum-instance validation) and enum values can't round-trip through pickle.Patches (both authored by Jason Koh):
migrate the enum serialization(987eec6): change generated__get_pydantic_core_schema__from plainint_schemato a chain that validates and reconstructs the enum instanceproper unpickle for enums(844ab9d): add__reduce__on the baseEnumclassFollow-up: after this merges and publishes as e.g.
betterproto-1.0.2on fury, mappedgpt-bot switches from the git URL tobetterproto = {index = "fury"}and dropsapt-get install gitfrom the Dockerfile.