From c0e8ef300010a892a46cef2c83fb51a2682fa365 Mon Sep 17 00:00:00 2001 From: koooge Date: Thu, 6 Jun 2019 17:02:08 +0900 Subject: [PATCH] Upgrade gspread 3.1.0 for supporting team drive (#3838) * Upgrade gspread 3.1.0 for supporting team drive Signed-off-by: koooge * Revert "Upgrade gspread 3.1.0 for supporting team drive" This reverts commit e53e8cb75bc02a478c7f7d973beb0e559b7d6cae. * Upgrade gspread 3.1.0 for supporting team drive Signed-off-by: koooge * Update Sheets query runner name --- redash/query_runner/google_spreadsheets.py | 9 ++++++--- requirements_all_ds.txt | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/redash/query_runner/google_spreadsheets.py b/redash/query_runner/google_spreadsheets.py index 3c22f45b7b..f14d2d446c 100644 --- a/redash/query_runner/google_spreadsheets.py +++ b/redash/query_runner/google_spreadsheets.py @@ -12,7 +12,6 @@ try: import gspread - from gspread.httpsession import HTTPSession from oauth2client.service_account import ServiceAccountCredentials enabled = True @@ -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): @@ -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 diff --git a/requirements_all_ds.txt b/requirements_all_ds.txt index f40320cc2a..5e827115ef 100644 --- a/requirements_all_ds.txt +++ b/requirements_all_ds.txt @@ -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