Skip to content
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

Same value for all merged cells #700

Closed
arredond opened this issue Oct 14, 2019 · 4 comments · Fixed by #1215
Closed

Same value for all merged cells #700

arredond opened this issue Oct 14, 2019 · 4 comments · Fixed by #1215

Comments

@arredond
Copy link

Currently, when you read from a spreadsheet that has merged (combined) cells, the value is only kept for the first of the individual cells that compose the merged cell.

It would be great to have a flag, when reading a spreadsheet wih get_all_records(), to duplicate that initial value for all individual cells that compose the merged cell.

@aiguofer
Copy link
Collaborator

I do this in https://github.com/aiguofer/gspread-pandas/blob/2d2d5a1049d15f0f6e8c19c990c7ca1de3fec2d1/gspread_pandas/spread.py#L785

I'd be happy to try to create a PR when I have some time

@lavigne958
Copy link
Collaborator

I am concerned about the detail: duplicate the initial value.
I merged cells in a spreadsheet and exported the sheet as csv file to have it in a way that looks similar to a list of lists with values.

I have the first 2 celles [A1, A2] are merged together with a value of 'XXX', the output as csv file contains the following line for those 2 celles: 'XXX,' which means the value of A2 is empty.

This is the behavior that google provides and I believe we should follow it, as people may use csv files before and now use gspread and expect a similar result.

@arredond
Copy link
Author

@lavigne958 that's a nice concern to have but the feature I'm proposing is just to have a parameter that controls this. I'm not saying what the default (to duplicate values or not) should be.

IMHO, what you're describing is a legacy behavior that, yes, some users might expect, but may be very unintuitive for others (such as myself). Having the option to choose is always nice :)

@lavigne958
Copy link
Collaborator

My apologies I did not get the "option" / "parameter" part,I ended up on this page from the PR and no the other-way around.

I do think this option is useful then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants