-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header whitespace regression in 5.12.0 #1354
Comments
Oh, thanks! Somehow I missed that in my issue search. |
Hmm... I think this is actually a different issue. I can still repro it with current master (0932358). |
ah, yes, I see the issue. Thanks for sticking with it. The code returning the error is here Lines 689 to 699 in 0932358
Keys is obtained with Lines 658 to 660 in 0932358
values is obtained with Lines 682 to 687 in 0932358
The problem is that #1353 changed the way that the header row is obtained (in f6f0658). Beforehand, it was just the first row in the data Lines 547 to 553 in 3e5976e
Thus, the cells are obtained as thus: beforeafterThis is because the Google Sheets API cuts off the right and bottom of requested ranges if they are empty cells (see #1289) Thus, the number of values (4) is wider than the number of keys (2), so the condition Now, #1353 exists so you can get the data from only rows 100-150 (e.g.) while still using a row 1 as the header row (e.g.). So we can't recombine the requests. We will probably have to make sure the Lines 546 to 557 in 0932358
If we do that, we can probably remove this code Lines 694 to 703 in 0932358
because it is covered by this logic Lines 664 to 666 in 0932358
I do not have much time this week to code. If you would like to try the fix it should be simple enough. Otherwise we will get round to it and it should get into v5.12.1 Thanks again for the report :) |
I agree we should fill gaps the headers too, to make sure the header row matches the requested range size and prevent the google default behavior of stripping the empty cells. Though we should keep in mind that in this particular scenario column |
yep
Here, |
Hi. Please read the proposal for changing how |
5.12.0 no longer tolerates sheets with filled-in cells that are not under a header. (For example, there might be a summary table off to the side of the main data.)
Repro data
Expected (old) behavior:
In 5.11.3 the output is
[{'aaa': 'w', 'bbb': 'x', '': ''}, {'aaa': 'y', 'bbb': 'z', '': 'other'}]
Unexpected (new) behavior:
5.12.0 raises
gspread.exceptions.GSpreadException: the header row in the worksheet contains multiple empty cells
Environment info
The text was updated successfully, but these errors were encountered: