From 467bd838452fd308d329e27758357c61d7e0c45d Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Sat, 7 Dec 2019 11:06:26 -0800 Subject: [PATCH] Correct the return types --- src/python/grpcio/grpc/experimental/aio/_channel.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/python/grpcio/grpc/experimental/aio/_channel.py b/src/python/grpcio/grpc/experimental/aio/_channel.py index 849b9bd6f81..1c77bfb0d1c 100644 --- a/src/python/grpcio/grpc/experimental/aio/_channel.py +++ b/src/python/grpcio/grpc/experimental/aio/_channel.py @@ -18,6 +18,7 @@ from typing import Any, Optional, Sequence, Text, Tuple import grpc from grpc import _common from grpc._cython import cygrpc +from . import _base_call from ._call import Call, UnaryUnaryCall, UnaryStreamCall from ._typing import (DeserializingFunction, MetadataType, SerializingFunction) @@ -48,7 +49,8 @@ class UnaryUnaryMultiCallable: metadata: Optional[MetadataType] = None, credentials: Optional[grpc.CallCredentials] = None, wait_for_ready: Optional[bool] = None, - compression: Optional[grpc.Compression] = None) -> Call: + compression: Optional[grpc.Compression] = None + ) -> _base_call.UnaryUnaryCall: """Asynchronously invokes the underlying RPC. Args: @@ -117,7 +119,8 @@ class UnaryStreamMultiCallable: metadata: Optional[MetadataType] = None, credentials: Optional[grpc.CallCredentials] = None, wait_for_ready: Optional[bool] = None, - compression: Optional[grpc.Compression] = None) -> Call: + compression: Optional[grpc.Compression] = None + ) -> _base_call.UnaryStreamCall: """Asynchronously invokes the underlying RPC. Args: @@ -202,7 +205,8 @@ class Channel: self, method: Text, request_serializer: Optional[SerializingFunction] = None, - response_deserializer: Optional[DeserializingFunction] = None): + response_deserializer: Optional[DeserializingFunction] = None + ) -> UnaryUnaryMultiCallable: """Creates a UnaryUnaryMultiCallable for a unary-unary method. Args: @@ -224,7 +228,8 @@ class Channel: self, method: Text, request_serializer: Optional[SerializingFunction] = None, - response_deserializer: Optional[DeserializingFunction] = None): + response_deserializer: Optional[DeserializingFunction] = None + ) -> UnaryStreamMultiCallable: return UnaryStreamMultiCallable(self._channel, _common.encode(method), request_serializer, response_deserializer)