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

Draft: Initial merged cells support in get_cells() #290

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tzakharko
Copy link

Initial implementation for #289

This adds new columns n_rows and n_cols to the result of get_cells()/range_read_cells(). API response with the merged cell ranges is parsed in get_merged_ranges() and then left-joined by starting location into the cell table.

No updates to documentation, tests, or range formatting yet. Could also use error handling when implementing the join.

This adds new columns `n_rows` and `n_cols` to the result of `get_cells()/range_read_cells()`.  API response with the merged cell ranges is parsed in `get_merged_ranges()` and then left-joined by starting location into the cell table.
@tzakharko tzakharko changed the title Initial merged cells support in get_cells() Draft: Initial merged cells support in get_cells() May 29, 2023
@tzakharko tzakharko marked this pull request as draft May 29, 2023 17:29
@jennybc
Copy link
Member

jennybc commented Jun 2, 2023

I assume you've got a test sheet or two lying around with some merged cells that you are developing against.... can you share with "anyone with a link"? And share the ID here? Then I could experience this for myself. I can't really work on this feature right now, so to advance things, I have to be able to make intelligent comments with a modest amount of time/psychic energy.

@tzakharko
Copy link
Author

tzakharko commented Jun 3, 2023

Absolutely! Here a simple example sheet

devtools::load_all()

range_read_cells(
  "https://docs.google.com/spreadsheets/d/1wDJKdfSyvi2CCr-ZBzWslo4HQLsGAaMwpalAiq6KHws",
  discard_empty = TRUE
) %>%
dplyr::mutate(cell = purrr::map_chr(cell, "formattedValue"))

And the output

row col n_rows n_cols loc cell
1 1 1 1 A1 A1
2 2 1 1 B2 B2
3 1 1 1 A3 B3
4 2 2 2 B4 merged B4:C5
6 3 1 1 C6 C6
7 1 1 3 A7 merged A7:C7
8 1 1 1 A8 A8
9 1 3 1 A9 merged A9:A11
9 2 1 1 B9 B9
11 2 1 1 B11 B11

If you can just have a quick look and tell me whether you are ok with the general direction, I'd be happy to also add tests, documentation, missing checks etc. I kept it minimal on purpose for now. Thanks for your time!

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

Successfully merging this pull request may close these issues.

2 participants