Hello, I'm working on discord bots ( which use Python ) to fetch data from
google spreadsheet in order to perform some actions.
My code for fetching sheets:
async def fetch_sheet():
await bot.wait_until_ready()
global list_of_lists
i = 0
while True:
#if creds.access_token_expired:
client.login() # refreshes the token
list_of_lists = client.open('Guild Roster
2').worksheet("ViP1").get_all_values()
print("ViP Worksheet Access: Stable")
i += 1
print ('Sheet Fetch Count: {0}'.format(i))
await asyncio.sleep(60)
The following code returns an exception that max grid limit was reached or
something:
2019-04-21T07:16:12.347017+00:00 app[bot.1]: Task exception was never
retrieved
2019-04-21T07:16:12.347060+00:00 app[bot.1]: future: <Task finished
coro=<fetch_sheet() done, defined at main.py:63> exception=APIError('{\n
"error": {\n "code": 400,\n "message": "Range (\'ViP1\'!VIP1) exceeds
grid limits. Max rows: 1001, max columns: 20",\n "status":
"INVALID_ARGUMENT"\n }\n}\n',)>
2019-04-21T07:16:12.347062+00:00 app[bot.1]: Traceback (most recent call
last):
2019-04-21T07:16:12.347063+00:00 app[bot.1]: File "main.py", line 70, in
fetch_sheet
2019-04-21T07:16:12.347064+00:00 app[bot.1]: list_of_lists =
client.open('Guild Roster 2').worksheet("ViP1").get_all_values()
2019-04-21T07:16:12.347066+00:00 app[bot.1]: File
"/app/.heroku/python/lib/python3.6/site-packages/gspread/models.py", line
444, in get_all_values
2019-04-21T07:16:12.347068+00:00 app[bot.1]: data =
self.spreadsheet.values_get(self.title)
2019-04-21T07:16:12.347069+00:00 app[bot.1]: File
"/app/.heroku/python/lib/python3.6/site-packages/gspread/models.py", line
110, in values_get
2019-04-21T07:16:12.347070+00:00 app[bot.1]: r =
self.client.request('get', url, params=params)
2019-04-21T07:16:12.347071+00:00 app[bot.1]: File
"/app/.heroku/python/lib/python3.6/site-packages/gspread/client.py", line
79, in request
2019-04-21T07:16:12.347073+00:00 app[bot.1]: raise APIError(response)
2019-04-21T07:16:12.347074+00:00 app[bot.1]: gspread.exceptions.APIError: {
2019-04-21T07:16:12.347075+00:00 app[bot.1]: "error": {
2019-04-21T07:16:12.347077+00:00 app[bot.1]: "code": 400,
2019-04-21T07:16:12.347078+00:00 app[bot.1]: "message": "Range
('ViP1'!VIP1) exceeds grid limits. Max rows: 1001, max columns: 20",
2019-04-21T07:16:12.347079+00:00 app[bot.1]: "status":
"INVALID_ARGUMENT"
2019-04-21T07:16:12.347080+00:00 app[bot.1]: }
2019-04-21T07:16:12.347082+00:00 app[bot.1]: }
Please look into and help me, if you need any more info I'd be happy to
share :D
--
You received this message because you are subscribed to the Google Groups
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.