Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: retry google.auth TransportError by default #624

Merged
merged 1 commit into from Apr 23, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/bigquery/retry.py
Expand Up @@ -14,6 +14,7 @@

from google.api_core import exceptions
from google.api_core import retry
from google.auth import exceptions as auth_exceptions
import requests.exceptions


Expand All @@ -27,6 +28,7 @@
exceptions.InternalServerError,
exceptions.BadGateway,
requests.exceptions.ConnectionError,
auth_exceptions.TransportError,
)


Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_retry.py
Expand Up @@ -51,6 +51,12 @@ def test_w_unstructured_requests_connectionerror(self):
exc = requests.exceptions.ConnectionError()
self.assertTrue(self._call_fut(exc))

def test_w_auth_transporterror(self):
from google.auth.exceptions import TransportError

exc = TransportError("testing")
self.assertTrue(self._call_fut(exc))

def test_w_unstructured_too_many_requests(self):
from google.api_core.exceptions import TooManyRequests

Expand Down