Skip to content

Commit 34ecc3f

Browse files
authored
feat: retry google.auth TransportError by default (#624)
1 parent 6ee5824 commit 34ecc3f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

google/cloud/bigquery/retry.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from google.api_core import exceptions
1616
from google.api_core import retry
17+
from google.auth import exceptions as auth_exceptions
1718
import requests.exceptions
1819

1920

@@ -27,6 +28,7 @@
2728
exceptions.InternalServerError,
2829
exceptions.BadGateway,
2930
requests.exceptions.ConnectionError,
31+
auth_exceptions.TransportError,
3032
)
3133

3234

tests/unit/test_retry.py

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def test_w_unstructured_requests_connectionerror(self):
5151
exc = requests.exceptions.ConnectionError()
5252
self.assertTrue(self._call_fut(exc))
5353

54+
def test_w_auth_transporterror(self):
55+
from google.auth.exceptions import TransportError
56+
57+
exc = TransportError("testing")
58+
self.assertTrue(self._call_fut(exc))
59+
5460
def test_w_unstructured_too_many_requests(self):
5561
from google.api_core.exceptions import TooManyRequests
5662

0 commit comments

Comments
 (0)