From 4a24d8250fb2dc3fdf10f645b4504849714d46ce Mon Sep 17 00:00:00 2001 From: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com> Date: Fri, 11 Aug 2023 04:30:40 +0900 Subject: [PATCH] [Type hints] Fix type hints in aio._interceptors.py (#28770) As per the title. <!-- Your pull request will be routed to the following person by default for triaging. If you know who should review your pull request, please remove the mentioning below. --> @donnadionne --- src/python/grpcio/grpc/aio/_interceptor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/python/grpcio/grpc/aio/_interceptor.py b/src/python/grpcio/grpc/aio/_interceptor.py index 953ed2d18b7..dc750926df8 100644 --- a/src/python/grpcio/grpc/aio/_interceptor.py +++ b/src/python/grpcio/grpc/aio/_interceptor.py @@ -741,7 +741,7 @@ class InterceptedUnaryStreamCall( # pylint: disable=too-many-arguments async def _invoke( self, - interceptors: Sequence[UnaryUnaryClientInterceptor], + interceptors: Sequence[UnaryStreamClientInterceptor], method: bytes, timeout: Optional[float], metadata: Optional[Metadata], @@ -757,7 +757,7 @@ class InterceptedUnaryStreamCall( interceptors: List[UnaryStreamClientInterceptor], client_call_details: ClientCallDetails, request: RequestType, - ) -> _base_call.UnaryUnaryCall: + ) -> _base_call.UnaryStreamCall: if interceptors: continuation = functools.partial( _run_interceptor, interceptors[1:] @@ -874,7 +874,7 @@ class InterceptedStreamUnaryCall( """Run the RPC call wrapped in interceptors""" async def _run_interceptor( - interceptors: Iterator[UnaryUnaryClientInterceptor], + interceptors: Iterator[StreamUnaryClientInterceptor], client_call_details: ClientCallDetails, request_iterator: RequestIterableType, ) -> _base_call.StreamUnaryCall: @@ -921,7 +921,9 @@ class InterceptedStreamStreamCall( _loop: asyncio.AbstractEventLoop _channel: cygrpc.AioChannel - _last_returned_call_from_interceptors = Optional[_base_call.UnaryStreamCall] + _last_returned_call_from_interceptors = Optional[ + _base_call.StreamStreamCall + ] # pylint: disable=too-many-arguments def __init__(