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: update some types and add symmetry between the sync and async server interceptors #45

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

jeffsawatzky
Copy link
Contributor

This PR is just some minor tweaks.

NoReturn is a clearer return type for functions that are supposed to raise
https://docs.python.org/3/library/typing.html#typing.NoReturn

Added the code change from #43 to the async version as well. The test passes without it so I assume something in the actual gRPC library is making sure that we don't override the original status code, but I figured that we shouldn't call abort a second time anyway just to be safe.

Renamed a request parameter to request_or_iterator to match what it actually is and follow the same naming that is used elsewhere.

@codecov-commenter
Copy link

Codecov Report

Merging #45 (c75b4e5) into master (25edf03) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   94.66%   94.68%   +0.01%     
==========================================
  Files           7        7              
  Lines         375      376       +1     
  Branches       54       55       +1     
==========================================
+ Hits          355      356       +1     
  Misses         15       15              
  Partials        5        5              
Files Changed Coverage Δ
src/grpc_interceptor/server.py 95.08% <ø> (ø)
src/grpc_interceptor/exception_to_status.py 96.61% <100.00%> (+0.05%) ⬆️
src/grpc_interceptor/testing/dummy_client.py 89.93% <100.00%> (ø)

@d5h d5h merged commit 9e1b21f into d5h-foss:master Sep 1, 2023
17 checks passed
@d5h
Copy link
Collaborator

d5h commented Sep 1, 2023

Thank you!

@jeffsawatzky
Copy link
Contributor Author

@d5h can we get a release with these? I would like to extend these classes and use the NoReturn types without mypy errors.

@jeffsawatzky jeffsawatzky deleted the NoReturn branch October 17, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants