-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix grpc aio handler typing #15497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix grpc aio handler typing #15497
Changes from all commits
2626c88
ef1a1a1
4577db6
357a7fb
394c422
855e1a3
d81eaf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,6 @@ from grpc import ( | |||||||||||||
| GenericRpcHandler, | ||||||||||||||
| HandlerCallDetails, | ||||||||||||||
| RpcError, | ||||||||||||||
| RpcMethodHandler, | ||||||||||||||
| ServerCredentials, | ||||||||||||||
| StatusCode, | ||||||||||||||
| _Options, | ||||||||||||||
|
|
@@ -369,6 +368,21 @@ class StreamStreamClientInterceptor(ClientInterceptor, metaclass=abc.ABCMeta): | |||||||||||||
| request_iterator: AsyncIterable[_TRequest] | Iterable[_TRequest], | ||||||||||||||
| ) -> AsyncIterator[_TResponse] | StreamStreamCall[_TRequest, _TResponse]: ... | ||||||||||||||
|
|
||||||||||||||
| # Service-Side Handler: | ||||||||||||||
|
|
||||||||||||||
| @type_check_only | ||||||||||||||
| class RpcMethodHandler(Generic[_TRequest, _TResponse]): | ||||||||||||||
|
Comment on lines
+373
to
+374
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apart from marking non-existing runtime types with
Suggested change
|
||||||||||||||
| request_streaming: bool | ||||||||||||||
| response_streaming: bool | ||||||||||||||
|
|
||||||||||||||
| request_deserializer: _Deserializer[_TRequest] | None | ||||||||||||||
| response_serializer: _Serializer[_TResponse] | None | ||||||||||||||
|
|
||||||||||||||
| unary_unary: Callable[[_TRequest, ServicerContext[_TRequest, _TResponse]], Awaitable[_TResponse]] | None | ||||||||||||||
| unary_stream: Callable[[_TRequest, ServicerContext[_TRequest, _TResponse]], AsyncIterator[_TResponse]] | None | ||||||||||||||
| stream_unary: Callable[[AsyncIterator[_TRequest], ServicerContext[_TRequest, _TResponse]], Awaitable[_TResponse]] | None | ||||||||||||||
| stream_stream: Callable[[AsyncIterator[_TRequest], ServicerContext[_TRequest, _TResponse]], AsyncIterator[_TResponse]] | None | ||||||||||||||
|
|
||||||||||||||
| # Server-Side Interceptor: | ||||||||||||||
|
|
||||||||||||||
| class ServerInterceptor(metaclass=abc.ABCMeta): | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About tests: We only use tests for complex annotations. In this case, the tests basically replicate the type annotations, so we don't need them.