Skip to content

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
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
@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