Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Sep 11, 2024

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

@ohmayr ohmayr force-pushed the implement-async-rest-streaming-method branch from a4920e9 to f66182f Compare September 11, 2024 18:49
@ohmayr ohmayr marked this pull request as ready for review September 11, 2024 18:55
@ohmayr ohmayr requested a review from a team as a code owner September 11, 2024 18:55
@ohmayr ohmayr force-pushed the implement-async-rest-streaming-method branch from f66182f to 604a4bf Compare September 11, 2024 19:05
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Sep 11, 2024
@ohmayr ohmayr force-pushed the implement-generic-async-rest-method branch 2 times, most recently from 8baebaf to 9efcb8a Compare September 16, 2024 03:55
@ohmayr ohmayr force-pushed the implement-async-rest-streaming-method branch from 604a4bf to 9c161d5 Compare September 16, 2024 05:12
Base automatically changed from implement-generic-async-rest-method to async-rest-support-in-gapics September 17, 2024 18:20
@ohmayr ohmayr force-pushed the implement-async-rest-streaming-method branch 3 times, most recently from dcbae0c to e28ea63 Compare September 20, 2024 05:28
{# 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 %}:
Copy link
Contributor

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.

Copy link
Contributor Author

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 #}
Copy link
Contributor

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?

Copy link
Contributor Author

@ohmayr ohmayr Sep 20, 2024

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.

@ohmayr ohmayr force-pushed the implement-async-rest-streaming-method branch from e28ea63 to 232d255 Compare September 20, 2024 20:52
@ohmayr ohmayr merged commit 51a9104 into async-rest-support-in-gapics Sep 20, 2024
73 checks passed
@ohmayr ohmayr deleted the implement-async-rest-streaming-method branch September 20, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants