diff options
Diffstat (limited to 'tap_google_sheets/client.py')
-rw-r--r-- | tap_google_sheets/client.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tap_google_sheets/client.py b/tap_google_sheets/client.py index 0a0ce5a..4f38352 100644 --- a/tap_google_sheets/client.py +++ b/tap_google_sheets/client.py | |||
@@ -1,8 +1,7 @@ | |||
1 | from datetime import datetime, timedelta | 1 | from datetime import datetime, timedelta |
2 | from collections import OrderedDict | ||
2 | import backoff | 3 | import backoff |
3 | import requests | 4 | import requests |
4 | from collections import OrderedDict | ||
5 | |||
6 | import singer | 5 | import singer |
7 | from singer import metrics | 6 | from singer import metrics |
8 | from singer import utils | 7 | from singer import utils |
@@ -123,8 +122,7 @@ def raise_for_error(response): | |||
123 | error_code = response.get('error', {}).get('code') | 122 | error_code = response.get('error', {}).get('code') |
124 | ex = get_exception_for_error_code(error_code) | 123 | ex = get_exception_for_error_code(error_code) |
125 | raise ex(message) | 124 | raise ex(message) |
126 | else: | 125 | raise GoogleError(error) |
127 | raise GoogleError(error) | ||
128 | except (ValueError, TypeError): | 126 | except (ValueError, TypeError): |
129 | raise GoogleError(error) | 127 | raise GoogleError(error) |
130 | 128 | ||
@@ -196,9 +194,7 @@ class GoogleClient: # pylint: disable=too-many-instance-attributes | |||
196 | factor=3) | 194 | factor=3) |
197 | @utils.ratelimit(100, 100) | 195 | @utils.ratelimit(100, 100) |
198 | def request(self, method, path=None, url=None, api=None, **kwargs): | 196 | def request(self, method, path=None, url=None, api=None, **kwargs): |
199 | |||
200 | self.get_access_token() | 197 | self.get_access_token() |
201 | |||
202 | self.base_url = 'https://sheets.googleapis.com/v4' | 198 | self.base_url = 'https://sheets.googleapis.com/v4' |
203 | if api == 'files': | 199 | if api == 'files': |
204 | self.base_url = 'https://www.googleapis.com/drive/v3' | 200 | self.base_url = 'https://www.googleapis.com/drive/v3' |