get_all_records() returns error
See original GitHub issueWhen using get_all_records or get_all_values, the api errors with the following error:
gspread.exceptions.APIError: { "error": { "code": 400, "message": "Range ('DF1'!DF1) exceeds grid limits. Max rows: 10, max columns: 12", "status": "INVALID_ARGUMENT" }
I’m also unable to use sheet.row_count and sheet.col_count in combination with sheet.range() to get the entire sheet data.
code:
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'xxx-25a413f7fcd6.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open(sheet)
sheet = wks.worksheet(worksheet)
sheetData = sheet.get_all_records()
Stack trace or other output that would be helpful
File "C:/Users/xx/Documents/Python/doubleclick scraping/gspread_grabber.py", line 118, in read_gs
sheetData = sheet.get_all_records()
File "C:\Users\xx\AppData\Local\Programs\Python\Python36\lib\site-packages\gspread\models.py", line 470, in get_all_records
data = self.get_all_values()
File "C:\Users\xx\AppData\Local\Programs\Python\Python36\lib\site-packages\gspread\models.py", line 444, in get_all_values
data = self.spreadsheet.values_get(self.title)
File "C:\Users\xx\AppData\Local\Programs\Python\Python36\lib\site-packages\gspread\models.py", line 110, in values_get
r = self.client.request('get', url, params=params)
File "C:\Users\xx\AppData\Local\Programs\Python\Python36\lib\site-packages\gspread\client.py", line 79, in request
raise APIError(response)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:7 (1 by maintainers)
Top Results From Across the Web
GraphQL returns the error message "Cannot query field ...
GraphQL returns the error message "Cannot query field..." when I try to get all records ; 'query' => [ 'product' ; 'products' =>...
Read more >ThingWorx 8 Part 2 Error: Unable to Invoke Service...
"Error Executing Service, Unable to Invoke Service GetAllRecords on ACMESQLDatabase : null" ... connectionValidationString = SELECT NOW().
Read more >Return codes - IBM
CIM return code Description Method
0 Success GetFreeExtends() ListConfiguration. Backups()
0 Success AddNode()
0 Success CheckValidity()
Read more >How to handle ORA-01422 exact fetch returns more - Ask TOM
All of a sudden, when I try to insert values, then I got this Error. ORA-01422: exact fetch returns more than requested number...
Read more >Query | GORM - GORM
... when querying the database, and it will return the error ErrR. ... in the relevant field name or the dbname to Where()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mritzco,
Just came across this issue again and saw your reply - yes that works for me also. A PR would be great!
@burnash @ChamRoshi I think this is what happened: gspread does not single quote the sheetname when requesting the values. When you use a sheetname like DF1, stupid Google API will treat it as a range (here is the cell DF1 which usually does not exist), and looks the first sheet to find that cell.
I tested this by adding single quotes around the sheet name and it worked.
In the documentation: https://developers.google.com/sheets/api/guides/concepts#a1_notation:
@burnash could confirm and fix this ASAP?
Thank you!