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

Fix the order of fields in Protobuf #530

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

mristin
Copy link
Contributor

@mristin mristin commented Oct 27, 2024

Previously, we relied on the order of set for the fields in Protobuf. This is dangerous as the order of set is not well-defined across different Python versions and implementations.

To avoid potential bugs in the future, we fix the fields to correspond with the order of properties in the class.

Note that this solution is also not completely future proof. If you add properties in the middle of a class, the field IDs in protocol buffers will change causing incompatibility between the two Protocol Buffer definitions.

Previously, we relied on the order of ``set`` for the fields in
Protobuf. This is dangerous as the order of ``set`` is not well-defined
across different Python versions and implementations.

To avoid potential bugs in the future, we fix the fields to correspond
with the order of properties in the class.

Note that this solution is also not completely future proof. If you add
properties in the middle of a class, the field IDs in protocol buffers
will change causing incompatibility between the two Protocol Buffer
definitions.
@mristin mristin merged commit cc5acd8 into main Oct 27, 2024
0 of 2 checks passed
@mristin mristin deleted the mristin/Fix-order-of-properties-in-protobuf branch October 27, 2024 09:34
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.

1 participant