mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Fix code climate warnings
This commit is contained in:
parent
93df24de39
commit
7324f1f4c7
@ -134,9 +134,9 @@ class BigQuery(BaseQueryRunner):
|
||||
|
||||
key = json.loads(b64decode(self.configuration['jsonKeyFile']))
|
||||
|
||||
credentials = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
creds = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
http = httplib2.Http(timeout=settings.BIGQUERY_HTTP_TIMEOUT)
|
||||
http = credentials.authorize(http)
|
||||
http = creds.authorize(http)
|
||||
|
||||
return build("bigquery", "v2", http=http)
|
||||
|
||||
|
@ -81,8 +81,8 @@ class GoogleAnalytics(BaseSQLQueryRunner):
|
||||
def _get_analytics_service(self):
|
||||
scope = ['https://www.googleapis.com/auth/analytics.readonly']
|
||||
key = json.loads(b64decode(self.configuration['jsonKeyFile']))
|
||||
credentials = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
return build('analytics', 'v3', http=credentials.authorize(httplib2.Http()))
|
||||
creds = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
return build('analytics', 'v3', http=creds.authorize(httplib2.Http()))
|
||||
|
||||
def run_query(self, query, user):
|
||||
logger.debug("Analytics is about to execute query: %s", query)
|
||||
|
@ -164,8 +164,8 @@ class GoogleSpreadsheet(BaseQueryRunner):
|
||||
]
|
||||
|
||||
key = json.loads(b64decode(self.configuration['jsonKeyFile']))
|
||||
credentials = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
spreadsheetservice = gspread.authorize(credentials)
|
||||
creds = ServiceAccountCredentials.from_json_keyfile_dict(key, scope)
|
||||
spreadsheetservice = gspread.authorize(creds)
|
||||
return spreadsheetservice
|
||||
|
||||
def test_connection(self):
|
||||
|
Loading…
Reference in New Issue
Block a user