question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate header check in 5.2.0 is not backward compatible

See original GitHub issue

Describe 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:

  1. Run get_all_records on a spreadsheet with multiple columns with a blank header.
  2. 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:17

github_iconTop GitHub Comments

9reactions
MartinVardanyancommented, Mar 10, 2022

I solved this problem. The problem was in gspread version. Just install 5.1.1 instead of 5.2.0.

3reactions
deepansh96commented, Aug 30, 2022

This was still happening to me My version is 5.4.0

Workaround :

sheet_ref = gspread_client.open_by_key(sheet_key).get_worksheet_by_id(worksheet_gid)
expected_headers = sheet_ref.row_values(1)
all_records = sheet_ref.get_all_records(expected_headers=expected_headers)
Read more comments on GitHub >

github_iconTop Results From Across the Web

google chrome - Duplicate headers received from server
The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website...
Read more >
QUAST 5.2.0 manual
QUAST 5.2.0 manual. QUAST stands for QUality ASsessment Tool. The tool evaluates genome assemblies by computing various metrics.
Read more >
Upgrading ksqlDB | Confluent Documentation
For backward compatibility, existing running queries aren't affected by this change, and they will continue to run with the same column names.
Read more >
$ude - Rocket Software Documentation
Perform actions on Repository data and resources, including compiling, exporting, importing, and converting.
Read more >
QP/C++: Revision History - Quantum Leaps
Added new directory qpcpp/test/ for system-level testing of QP/C itself. ... Note: The API changes are not backwards-compatible and require ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found