| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks great! Let's block this until we figure out google-cloud-bigquery-storage though. googleapis/python-bigquery-storage#414
Sorry, something went wrong.
| try: | ||
| call = self._start_rpc(iter(request_generator), metadata=self._rpc_metadata) | ||
| except exceptions.GoogleAPICallError as exc: | ||
| self._on_call_done(exc) |
There was a problem hiding this comment.
on_call_done expects a future (based on the name of its argument). How does it work with an exception here?
Sorry, something went wrong.
There was a problem hiding this comment.
The exception will be raised in the call back add_done_callback and must be handled by the user. This is based on the comment here:
python-api-core/google/api_core/bidi.py
Lines 608 to 610 in 8f73d2e
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
The change that I proposed is exactly the same behaviour as the _on_call_done method of ResumableBidiRpc
python-api-core/google/api_core/bidi.py
Lines 441 to 443 in 6251eab
From grpc/grpc#10885 (comment), grpc.RpcError is also grpc.Call.
I added this note in c7f63bd
Sorry, something went wrong.
There was a problem hiding this comment.
I reverted c7f63bd because GoogleAPICallError is not grpc.Call or grpc.RpcError. The original grpc.RpcError is available on the response property of GoogleAPICallError
python-api-core/google/api_core/grpc_helpers.py
Lines 174 to 182 in 6251eab
The behaviour proposed in this PR is the same as ResumableBidiRpc and we typically raise GoogleAPICallError instead of grpc.RpcError
Sorry, something went wrong.
There was a problem hiding this comment.
I changed the code in 753a591 to raise grpc.RpcError instead of GoogleAPICallError since grpc.RpcError is also grpc.Call and it is a better fit
Sorry, something went wrong.
|
@loferris, please could you review/approve? |
Sorry, something went wrong.
|
@rosiezou You might be interested in this PR. I forget the full context, but I know it's something I wanted for better debugging of the Python BQ Storage Write API. |
Sorry, something went wrong.
|
@vchudnov-g Please could you take a look? |
Sorry, something went wrong.
| self._request_queue, initial_request=self._initial_request | ||
| ) | ||
| call = self._start_rpc(iter(request_generator), metadata=self._rpc_metadata) | ||
| try: |
There was a problem hiding this comment.
In examining this file, it seems to me that _RequestQueueGenerator._is_active (lines 91 et seq) should be defd as return self.call is not None and self.call.is_active(). The way it's currently written it will return True when self.call == None
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed in e120a0c
Sorry, something went wrong.
| try: | ||
| call = self._start_rpc(iter(request_generator), metadata=self._rpc_metadata) | ||
| except exceptions.GoogleAPICallError as exc: | ||
| self._on_call_done(exc) |
Sorry, something went wrong.
|
@vchudnov-g Please could you take another look? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #268🦕
This PR updates the bidi.py code to reflect what is stated in the comments.
The comment for add_done_callback states This occurs when the RPC errors or is successfully terminated. however the done callback was not being called when an error occurs.
python-api-core/google/api_core/bidi.py
Lines 255 to 264 in 2477ab9
python-api-core/google/api_core/bidi.py
Lines 267 to 269 in 2477ab9