Visitar URL original
fix: make sure that the proper exception type is bubbled up for ReadRows by igorbernstein2 路 Pull Request #696 路 googleapis/python-bigtable 路 GitHub
Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions google/cloud/bigtable/row_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ class InvalidRetryRequest(RuntimeError):


def _retry_read_rows_exception(exc):
if isinstance(exc, grpc.RpcError):
exc = exceptions.from_grpc_error(exc)
return isinstance(exc, (exceptions.ServiceUnavailable, exceptions.DeadlineExceeded))


Expand Down Expand Up @@ -471,7 +469,10 @@ def _on_error(self, exc):

def _read_next(self):
"""Helper for :meth:`__iter__`."""
return six.next(self.response_iterator)
try:
return six.next(self.response_iterator)
except grpc.RpcError as grpc_error:
raise exceptions.from_grpc_error(grpc_error)

def _read_next_response(self):
"""Helper for :meth:`__iter__`."""
Expand Down
14 changes: 0 additions & 14 deletions tests/unit/test_row_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,6 @@ def test_w_miss_wrapped_in_grpc(self):
exception = self._make_grpc_call_error(wrapped)
self.assertFalse(self._call_fut(exception))

def test_w_service_unavailable_wrapped_in_grpc(self):
from google.api_core.exceptions import ServiceUnavailable

wrapped = ServiceUnavailable("testing")
exception = self._make_grpc_call_error(wrapped)
self.assertTrue(self._call_fut(exception))

def test_w_deadline_exceeded_wrapped_in_grpc(self):
from google.api_core.exceptions import DeadlineExceeded

wrapped = DeadlineExceeded("testing")
exception = self._make_grpc_call_error(wrapped)
self.assertTrue(self._call_fut(exception))


class TestPartialRowsData(unittest.TestCase):
ROW_KEY = b"row-key"
Expand Down