From a5fdff0075a2f46a1b2e427c22f04d656bac1017 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 17 Feb 2023 18:19:31 +0000 Subject: [PATCH] fix: fix mypy error with rest interceptors --- .../%sub/services/%service/transports/rest.py.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 index 7d8e72846e..95ce8eec6c 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 @@ -121,7 +121,9 @@ class {{ service.name }}RestInterceptor: {% endfor %} {% for name, signature in api.mixin_api_signatures.items() %} - def pre_{{ name|snake_case }}(self, request: {{signature.request_type}}, metadata: Sequence[Tuple[str, str]]) -> {{signature.response_type}}: + def pre_{{ name|snake_case }}( + self, request: {{signature.request_type}}, metadata: Sequence[Tuple[str, str]] + ) -> Tuple[{{signature.request_type}}, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for {{ name|snake_case }} Override in a subclass to manipulate the request or metadata @@ -129,7 +131,9 @@ class {{ service.name }}RestInterceptor: """ return request, metadata - def post_{{ name|snake_case }}(self, response: {{signature.request_type}}) -> {{signature.response_type}}: + def post_{{ name|snake_case }}( + self, response: {{signature.response_type}} + ) -> {{signature.response_type}}: """Post-rpc interceptor for {{ name|snake_case }} Override in a subclass to manipulate the response