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

Commit e915411

Browse files
committed
addressed Gemini comments
1 parent d32616b commit e915411

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

google/cloud/bigtable/data/_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
_DEFAULT_BIGTABLE_EMULATOR_CLIENT = "google-cloud-bigtable-emulator"
5050

5151
# Internal error messages that can be retried during ReadRows. Internal error messages with this error
52-
# text should be streated as Unavailable error messages with the same error text, and will therefore be
52+
# text should be treated as Unavailable error messages with the same error text, and will therefore be
5353
# treated as Unavailable errors rather than Internal errors.
5454
_RETRYABLE_INTERNAL_ERROR_MESSAGES = (
5555
"rst_stream",
@@ -139,7 +139,7 @@ def _read_rows_predicate_with_exceptions(*exception_types: type[Exception]) -> C
139139
ServiceUnavailable errors and will retry them if the Unavailable exception is retryable.
140140
141141
Args:
142-
retryable_exceptions: tuple of Exception types to be retried during operation
142+
exception_types: Exception types to be retried during operation
143143
144144
Returns:
145145
Callable[[Exception], bool]: A retry predicate that takes in an exception and
@@ -148,7 +148,7 @@ def _read_rows_predicate_with_exceptions(*exception_types: type[Exception]) -> C
148148
is_exception_type = retries.if_exception_type(*exception_types)
149149

150150
def predicate(exception: Exception) -> bool:
151-
return (isinstance(exception, core_exceptions.InternalServerError) and exception.message.lower() in _RETRYABLE_INTERNAL_ERROR_MESSAGES) or is_exception_type(exception)
151+
return (isinstance(exception, core_exceptions.InternalServerError) and any(m in exception.message.lower() for m in _RETRYABLE_INTERNAL_ERROR_MESSAGES)) or is_exception_type(exception)
152152

153153
# Treating RST_STREAM internal errors as unavailable errors is only done if ServiceUnavailable is one of the
154154
# given exception types. If InternalServerError is also a retryable exception, we don't necessarily need the

0 commit comments

Comments
 (0)