-
Notifications
You must be signed in to change notification settings - Fork 223
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
include_tailing_empty=False causes crash in get_as_df when last column is empty #423
Comments
Hi, it shouldn't throw an error but it does makes sense to forcefully enable May i ask what is the behavior you are expecting when calling with has_header and include_tailing_empty=True? |
With |
Right now, I'm getting around this with this block of code, which seems a little convoluted:
I realize that |
The error is because when I think its better to go with 1st option. |
I agree with you-- if the cells are empty in the Google sheet, it makes sense to auto fill with |
Just wanted to chime in to say it'd be great to get this fixed! |
Looking at the commit that closed out this issue (and the behavior of If I were to submit a pull request to change this behavior to option 1 instead, would it be better for the the Just a side note that returning extra columns with empty strings as names is very hard to debug. Interactively, pandas printouts do not make it obvious that those columns exist. And by specifying |
When include_tailing_empty=False, now returns a DataFrame just as wide as necessary to accommodate the header/data. Issues a warning if has_header=True and >=1 column name is an empty string.
Merged @RussianImperialScott 's PR hence the default behavior is changed to option 1. |
Note, if this is a usage question, please ask a question in stackoverflow with
pygsheets
tag.Describe the bug
When using worksheet.get_as_df and setting include_tailing_empty=False, a completely empty final named column leads to a crash. It'd be nicer to gracefully return a df with
To Reproduce
Steps to reproduce the behavior: make a google sheet with a rightmost named column with empty cells below. attempt worksheet.get_as_df
code here ...
System Information
The text was updated successfully, but these errors were encountered: