【发布时间】:2020-10-21 20:52:28
【问题描述】:
尝试将 batch_update 发布到 Google 工作表时出现以下错误。我要发布到的工作表中有 5600 行
('/home/xx/xxx/xx.csv', <Spreadsheet u'spreadsheet name' id:id#>, 'A5600')
Traceback (most recent call last):
File "xx.py", line 50, in <module>
pasteCsv(csvFile, sheet, cell)
File "xx.py", line 38, in pasteCsv
return sheet.batch_update(body)
File "/home/xx/.local/lib/python2.7/site-packages/gspread/models.py", line 146, in batch_update
'post', SPREADSHEET_BATCH_UPDATE_URL % self.id, json=body
File "/home/xx/.local/lib/python2.7/site-packages/gspread/client.py", line 73, in request
raise APIError(response)
gspread.exceptions.APIError: {u'status': u'INVALID_ARGUMENT', u'message': u'Invalid requests[0].pasteData: GridCoordinate.rowIndex[5599] is after last row in grid[999]', u'code': 400}
有没有办法将网格从 [999] 更改为更高的数字,以便我能够发布 csv 文件内容?
【问题讨论】:
-
我认为当你提供你当前的脚本时,它会帮助用户思考解决方案。
标签: python google-sheets-api gspread