diff --git a/src/python/grpcio/grpc/experimental/aio/_channel.py b/src/python/grpcio/grpc/experimental/aio/_channel.py index a0461632fa8..2788f4416e0 100644 --- a/src/python/grpcio/grpc/experimental/aio/_channel.py +++ b/src/python/grpcio/grpc/experimental/aio/_channel.py @@ -49,13 +49,15 @@ class _BaseMultiCallable: _interceptors: Optional[Sequence[UnaryUnaryClientInterceptor]] _loop: asyncio.AbstractEventLoop - def __init__(self, channel: cygrpc.AioChannel, - method: bytes, - request_serializer: SerializingFunction, - response_deserializer: DeserializingFunction, - interceptors: Optional[Sequence[UnaryUnaryClientInterceptor]], - loop: asyncio.AbstractEventLoop, - ) -> None: + def __init__( + self, + channel: cygrpc.AioChannel, + method: bytes, + request_serializer: SerializingFunction, + response_deserializer: DeserializingFunction, + interceptors: Optional[Sequence[UnaryUnaryClientInterceptor]], + loop: asyncio.AbstractEventLoop, + ) -> None: self._loop = loop self._channel = channel self._method = method @@ -385,8 +387,7 @@ class Channel: Returns: A UnaryUnaryMultiCallable value for the named unary-unary method. """ - return UnaryUnaryMultiCallable(self._channel, - _common.encode(method), + return UnaryUnaryMultiCallable(self._channel, _common.encode(method), request_serializer, response_deserializer, self._unary_unary_interceptors, @@ -398,11 +399,9 @@ class Channel: request_serializer: Optional[SerializingFunction] = None, response_deserializer: Optional[DeserializingFunction] = None ) -> UnaryStreamMultiCallable: - return UnaryStreamMultiCallable(self._channel, - _common.encode(method), + return UnaryStreamMultiCallable(self._channel, _common.encode(method), request_serializer, - response_deserializer, - None, self._loop) + response_deserializer, None, self._loop) def stream_unary( self, @@ -410,11 +409,9 @@ class Channel: request_serializer: Optional[SerializingFunction] = None, response_deserializer: Optional[DeserializingFunction] = None ) -> StreamUnaryMultiCallable: - return StreamUnaryMultiCallable(self._channel, - _common.encode(method), + return StreamUnaryMultiCallable(self._channel, _common.encode(method), request_serializer, - response_deserializer, - None, self._loop) + response_deserializer, None, self._loop) def stream_stream( self, @@ -422,11 +419,10 @@ class Channel: request_serializer: Optional[SerializingFunction] = None, response_deserializer: Optional[DeserializingFunction] = None ) -> StreamStreamMultiCallable: - return StreamStreamMultiCallable(self._channel, - _common.encode(method), + return StreamStreamMultiCallable(self._channel, _common.encode(method), request_serializer, - response_deserializer, - None, self._loop) + response_deserializer, None, + self._loop) async def _close(self): # TODO: Send cancellation status diff --git a/src/python/grpcio_tests/tests_aio/unit/call_test.py b/src/python/grpcio_tests/tests_aio/unit/call_test.py index b2faf1af135..a1bd243f81c 100644 --- a/src/python/grpcio_tests/tests_aio/unit/call_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/call_test.py @@ -48,6 +48,7 @@ class _MulticallableTestMixin(): class TestUnaryUnaryCall(_MulticallableTestMixin, AioTestBase): + async def test_call_to_string(self): call = self._stub.UnaryCall(messages_pb2.SimpleRequest())