Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

feat: support with_call for wrapped rpcs - #550

Merged
daniel-sanche merged 4 commits into
mainfrom
support_with_call
Nov 9, 2023
Merged

feat: support with_call for wrapped rpcs#550
daniel-sanche merged 4 commits into
mainfrom
support_with_call

Conversation

@daniel-sanche

Copy link
Copy Markdown
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 teamNovember 9, 2023 20:32
@product-auto-labelproduct-auto-labelBot added the size: s Pull request size is small. label Nov 9, 2023
@vchudnov-g

Copy link
Copy Markdown
Contributor

@daniel-sanche Could you fix the lint error?

@daniel-sanche

Copy link
Copy Markdown
ContributorAuthor

@daniel-sanche Could you fix the lint error?

fixed, thanks

@daniel-sanche
daniel-sanche merged commit 01a57a7 into mainNov 9, 2023
@daniel-sanche
daniel-sanche deleted the support_with_call branch November 9, 2023 21:31
@release-pleaserelease-pleaseBot mentioned this pull request Nov 9, 2023
This was referenced May 30, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: sPull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@daniel-sanche@vchudnov-g