Skip to content
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

fix: fix mypy error with rest interceptors #1603

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,19 @@ 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]]]:
atulep marked this conversation as resolved.
Show resolved Hide resolved
"""Pre-rpc interceptor for {{ name|snake_case }}

Override in a subclass to manipulate the request or metadata
before they are sent to the {{ service.name }} server.
"""
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
Expand Down