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

Improve error message when attempting to add a footnote to a hidden column or ignore footnotes added to hidden col #1807

Open
olivroy opened this issue Jul 18, 2024 · 1 comment

Comments

@olivroy
Copy link
Collaborator

olivroy commented Jul 18, 2024

I encountered this error in a more complex context, but I figured out how to make a reproducible example!

exibble %>% 
  gt() %>% 
  cols_hide(num) %>% 
  tab_footnote("X", locations = cells_column_labels(num)) 
#> Error in `dplyr::mutate()`:
#> ℹ In argument: `fs_id_coalesced = paste(fs_id, collapse = ",")`.
#> ℹ In group 1: `colname = "num"`.
#> Caused by error:
#> ! object 'fs_id' not found

I double-checked that this error occurs in both gt 0.10.1 and gt 0.11, so not due to my refactoring!

@rich-iannone
Copy link
Member

rich-iannone commented Sep 27, 2024

For this one, I don't think an error ought to occur. We can add footnotes to visible columns, hide those columns, and gt would know to skip footnotes in those columns. Also, we can reverse the hiding of columns with cols_unhide() so any footnotes placed on hidden data could become visible again (if there wasn't an error to begin with).

@rich-iannone rich-iannone added this to the v0.13.0 milestone Sep 27, 2024
@olivroy olivroy changed the title Improve error message when attempting to add a footnote to a hidden column Improve error message when attempting to add a footnote to a hidden column or ignore footnotes added to hidden col Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants