I recently upgraded a self hosted instance of Redash from v2 to v5. Seemed to get it all working, but have just noticed that Google Spreadsheets datasource is missing.
This was previously working in v2, but now the option to create a Google Spreadsheet datasource is gone. The queries using Google Spreadsheets from the previous version are still there, but won’t update and result in error " Error running query: ‘NoneType’ object has no attribute ‘annotate_query’"
I have tried updating google-api-python-client (now v1.7.4), oauth2client (now v4.1.3) and gspread (now v3.0.1), then restarted Redash, as suggested if having issues with data source availability.
from oauth2client.service_account import ServiceAccountCredentials
received the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/oauth2client/service_account.py", line 26, in <module>
from oauth2client import crypt
File "/usr/local/lib/python2.7/dist-packages/oauth2client/crypt.py", line 23, in <module>
from oauth2client import _pure_python_crypt
File "/usr/local/lib/python2.7/dist-packages/oauth2client/_pure_python_crypt.py", line 24, in <module>
from pyasn1_modules.rfc2459 import Certificate
File "/usr/local/lib/python2.7/dist-packages/pyasn1_modules/rfc2459.py", line 20, in <module>
from pyasn1.type import opentype
ImportError: cannot import name opentype
So I upgraded google-auth-oauthlib & pyasn1-modules, restarted, and Google Spreadsheets are now there!
Unfortunately I’m still having an issue with some of the associated queries and there isn’t anything obvious to me that is wrong. For a given spreadsheet, some sheets return results without an issue, but others come back with the error “Error running query: **‘NoneType’ object is not iterable**”.
It seems that if a sheet has any text in the columns (excluding headings), then it will fail, but if the data is either numeric or a date, it works. For an example of an extremely simple summary that fails, see below.