Skip to content

Commit

Permalink
Upgrade gspread 3.1.0 for supporting team drive (getredash#3838)
Browse files Browse the repository at this point in the history
* Upgrade gspread 3.1.0 for supporting team drive

Signed-off-by: koooge <koooooge@gmail.com>

* Revert "Upgrade gspread 3.1.0 for supporting team drive"

This reverts commit e53e8cb.

* Upgrade gspread 3.1.0 for supporting team drive

Signed-off-by: koooge <koooooge@gmail.com>

* Update Sheets query runner name
  • Loading branch information
koooge authored and harveyrendell committed Nov 14, 2019
1 parent bb28e4d commit 63fa050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions redash/query_runner/google_spreadsheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

try:
import gspread
from gspread.httpsession import HTTPSession
from oauth2client.service_account import ServiceAccountCredentials

enabled = True
Expand Down Expand Up @@ -135,6 +134,10 @@ def __init__(self, configuration):
@classmethod
def annotate_query(cls):
return False

@classmethod
def name(cls):
return "Google Sheets"

@classmethod
def type(cls):
Expand Down Expand Up @@ -166,9 +169,9 @@ def _get_spreadsheet_service(self):
key = json_loads(b64decode(self.configuration['jsonKeyFile']))
creds = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)

timeout_session = HTTPSession()
timeout_session = Session()
timeout_session.requests_session = TimeoutSession()
spreadsheetservice = gspread.Client(auth=creds, http_session=timeout_session)
spreadsheetservice = gspread.Client(auth=creds, session=timeout_session)
spreadsheetservice.login()
return spreadsheetservice

Expand Down
2 changes: 1 addition & 1 deletion requirements_all_ds.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
google-api-python-client==1.5.1
gspread==0.6.2
gspread==3.1.0
impyla==0.10.0
influxdb==2.7.1
MySQL-python==1.2.5
Expand Down

0 comments on commit 63fa050

Please sign in to comment.