Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid pickling primitive values and proto messages #179

Merged
merged 7 commits into from
Jun 26, 2024

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Jun 25, 2024

This PR updates the SDK to avoid using pickle to serialize inputs and outputs unless necessary.

If an input or output value is a protobuf message, it's now serialized directly.

If an input or output value is primitive (null, boolean, integer, float, string, bytes, timestamp, duration), we serialize it using one of the built-in protobuf wrappers.

If an input or output value is a JSON-like list or dict, we serialize it using the built-in structpb wrappers.

@chriso chriso self-assigned this Jun 26, 2024
@chriso chriso marked this pull request as ready for review June 26, 2024 01:59
@chriso chriso changed the title Don't pickle proto messages before wrapping as google.protobuf.Any Avoid pickling primitive values and proto messages Jun 26, 2024
Copy link
Contributor

@achille-roussel achille-roussel left a comment

Choose a reason for hiding this comment

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

🚀

@chriso chriso merged commit 90b97d9 into main Jun 26, 2024
7 checks passed
@chriso chriso deleted the use-proto-for-serialization-if-available branch June 26, 2024 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants