Skip to content

Conversation

@daniel-sanche
Copy link
Contributor

Most grpc calls return a grpc.Call object, that contains trailing metadata and other useful information. You can then await (for async unary rpcs) or iterate over (for streaming rpcs) the Call object to get the proto results of the rpc.

This is not the case for unary synchronous calls, because there is no intermediate object. Calling the rpc results in the value directly. The grpc library provides with_call methods for this reason, which return a tuple of the rpc result and the Call object.

Currently, the gapic wrapper does not provide a way to access this data

This PR solves the issue by adding with_call to the wrap_method function, which will is passed down to the grpc callable

@daniel-sanche daniel-sanche requested review from a team as code owners November 9, 2023 20:32
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Nov 9, 2023
@vchudnov-g
Copy link
Contributor

@daniel-sanche Could you fix the lint error?

@daniel-sanche
Copy link
Contributor Author

@daniel-sanche Could you fix the lint error?

fixed, thanks

@daniel-sanche daniel-sanche merged commit 01a57a7 into main Nov 9, 2023
@daniel-sanche daniel-sanche deleted the support_with_call branch November 9, 2023 21:31
This was referenced May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants