-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add support for async rest streaming methods #2146
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
feat: add support for async rest streaming methods #2146
Conversation
a4920e9
to
f66182f
Compare
f66182f
to
604a4bf
Compare
8baebaf
to
9efcb8a
Compare
604a4bf
to
9c161d5
Compare
dcbae0c
to
e28ea63
Compare
{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2171): Update the return type for pager method. #} | ||
){% if not method.void %} -> {% if not method.server_streaming %}{{method.output.ident}}{% else %}None{% endif %}{% endif %}: | ||
{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2168): Implement server streaming method. #} | ||
){% if not method.void %} -> {% if not method.server_streaming %}{{method.output.ident}}{% else %}rest_streaming_async.AsyncResponseIterator{% endif %}{% endif %}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this present in any of the golden files? A search in this PR for rest_streaming_async.AsyncResponse
only yields results in these templates, and not the goldens. I want to see how the goldens changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes can be seen here: #2188
{% else %} | ||
pb_resp = resp | ||
{% endif %} | ||
{% endif %}{# if method.output.ident.is_proto_plus_type #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question: we handle proto_plus explicitly in the non-streaming case here. But what about in streaming results? Looking at api-core's _rest_streaming_base.py:BaseResponseIterator.grab()
, it's not obvious that we do. Do we? Should we? Is this question irrelevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've filed #2189 to Investigate this later.
e28ea63
to
232d255
Compare
This PR implements the call method for an asynchronous rest streaming method and updates the relevant unit tests to add coverage.
This PR should be reviewed and merged after: #2145
Fixes: #2168