You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As is visible, message_type is expected to be IProtoMessage, with a method FromString on it. However, because the Well-Known type is converted to Union[int, NoneType], this method cannot be called there.
I suspect that the current implementation handles these well-known types separately, and this works well when they are embedded in a message, but not when they are the top-level return-value from an RPC call. I intended to use Google's wrappers mainly to be able to return primitive values from RPC-calls.
Hi!
I'm running into some trouble returning
google.protobuf.Int32Value
from a unary RPC call.This is my service:
When I call that service (
await self.client.start_training_game(**kwargs)
), an exception is thrown'_SpecialForm' object has no attribute 'FromString'
.Debugging reveals the following stack frame (
proto.py:54
, ingrpclib
)As is visible,
message_type
is expected to beIProtoMessage
, with a methodFromString
on it. However, because the Well-Known type is converted toUnion[int, NoneType]
, this method cannot be called there.I suspect that the current implementation handles these well-known types separately, and this works well when they are embedded in a message, but not when they are the top-level return-value from an RPC call. I intended to use Google's wrappers mainly to be able to return primitive values from RPC-calls.
The generated Client shows the following:
I suppose that the generated code should specify the type as the python-generated equivalent of Int32Value, instead of
Optional[int]
.The text was updated successfully, but these errors were encountered: