Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: construct messages with nested duration in protobuf 5.28+ #519

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

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Jan 21, 2025

This fix is similar to #479 where message construction fails when a specific type, in this case google.protobuf.duration_pb2.Duration, is nested.

Fixes #518
Fixes googleapis/google-cloud-python#13350

@parthea parthea force-pushed the nested-duration-compatibility branch from 81cd01d to d851c1c Compare January 21, 2025 16:17
Copy link
Contributor

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! Only minor comments.

@@ -241,6 +241,26 @@ class Foo(proto.Message):
assert Foo.pb(foo).ttl.seconds == 120


def test_duration_write_string_nested():
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for clarity, I suggest:
s/another_field/foo_field/g
s/some_field/bar_field/g

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fcb5bb2

parthea and others added 3 commits January 21, 2025 15:45
@parthea parthea enabled auto-merge (squash) January 21, 2025 20:50
@parthea parthea merged commit 197ddf8 into main Jan 21, 2025
28 checks passed
@parthea parthea deleted the nested-duration-compatibility branch January 21, 2025 20: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
2 participants