diff options
author | Jeff Huth <jeff.huth@bytecode.io> | 2019-11-15 01:58:55 -0800 |
---|---|---|
committer | Jeff Huth <jeff.huth@bytecode.io> | 2019-11-15 01:58:55 -0800 |
commit | 99424fee5ba6ff830df39be8f47c3e3d685b444a (patch) | |
tree | 08ace54622092921ab7253946515ce5d3dcf0a66 /tap_google_sheets/client.py | |
parent | da690bda91ea6a14964a2378e5dbb5d4de91a7e2 (diff) | |
download | tap-google-sheets-99424fee5ba6ff830df39be8f47c3e3d685b444a.tar.gz tap-google-sheets-99424fee5ba6ff830df39be8f47c3e3d685b444a.tar.zst tap-google-sheets-99424fee5ba6ff830df39be8f47c3e3d685b444a.zip |
pylint and testingv0.0.1
pylint and testing
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' |