Duplicate header check in 5.2.0 is not backward compatible
See original GitHub issueDescribe the bug
A spreadsheet with multiple columns that had a blank header used to load using get_all_records
before 5.2.0, but it now fails with “headers must be uniques” exception. I presume, but did not confirm, that it is due to this simplification: https://github.com/burnash/gspread/commit/c8a5a7350c40498cf38d3c4a27c748100632804a
To Reproduce Steps to reproduce the behavior:
- Run
get_all_records
on a spreadsheet with multiple columns with a blank header. - See error “headers must be uniques”.
Expected behavior This should work as it used to without an error.
Environment info:
- Operating System [e.g. Linux, Windows, macOS]: macOS
- Python version: 3.8
- gspread version: 5.2.0
Stack trace or other output that would be helpful Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/edx/other/edx-repo-health/repo_health/check_ownership.py”, line 79, in check_ownership records = find_worksheet(google_creds_file, spreadsheet_url, worksheet_id) File “/edx/other/edx-repo-health/repo_health/check_ownership.py”, line 44, in find_worksheet return worksheet.get_all_records() File “/edx/venvs/edx-repo-health/lib/python3.8/site-packages/gspread/worksheet.py”, line 408, in get_all_records raise GSpreadException(“headers must be uniques”) gspread.exceptions.GSpreadException: headers must be uniques
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:17
Top GitHub Comments
I solved this problem. The problem was in gspread version. Just install 5.1.1 instead of 5.2.0.
This was still happening to me My version is 5.4.0
Workaround :