d5h-foss / grpc-interceptor

Simplified Python gRPC interceptors
MIT License
136 stars 21 forks source link

Fix the type for the context in the async exception to status interceptor #37

Closed jeffsawatzky closed 1 year ago

jeffsawatzky commented 1 year ago

Fixes #36

codecov-commenter commented 1 year ago

Codecov Report

Merging #37 (07bc6cd) into master (9f79f5b) will increase coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: 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      #37      +/-   ##
==========================================
+ Coverage   94.78%   94.79%   +0.01%     
==========================================
  Files           7        7              
  Lines         364      365       +1     
  Branches       51       51              
==========================================
+ Hits          345      346       +1     
  Misses         15       15              
  Partials        4        4              
Impacted Files Coverage Δ
src/grpc_interceptor/exception_to_status.py 96.49% <100.00%> (+0.06%) :arrow_up:
d5h commented 1 year ago

Cool, thank you Jeff! Is this causing any actual issues that require a new release? If so you’ll also need to bump the version number in pyproject.toml. If not then this is good to go and I’ll just bundle it into the next release whenever that happens to be.

jeffsawatzky commented 1 year ago

In order for mypy not to complain when I try to abort with trailing metadata, I need to cast the context to the aio version. The sync definition looks like this: https://grpc.github.io/grpc/python/grpc.html#grpc.ServicerContext.abort

The async definition looks like this: https://grpc.github.io/grpc/python/grpc_asyncio.html#grpc.aio.ServicerContext.abort

So there is a slight difference, and having to cast is annoying. I have bumped the version number as requested.

d5h commented 1 year ago

Ok. I’ll try to get the new version released sometime today. By the way, a patch version bump seems more appropriate for this kind of thing, so I made a small edit there. Thanks again!

d5h commented 1 year ago

This is now released as 0.15.2.