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

Support for lazy tibbles #242

Closed
mgirlich opened this issue Jul 1, 2021 · 3 comments · Fixed by #309
Closed

Support for lazy tibbles #242

mgirlich opened this issue Jul 1, 2021 · 3 comments · Fixed by #309
Labels
feature a feature request or enhancement
Milestone

Comments

@mgirlich
Copy link

mgirlich commented Jul 1, 2021

Lazy tibbles currently have two issues with eval_select():

  1. They are not a vector so one has to simulate a "dummy" tibble with the appropriate column names, e.g with dtplyr:::simulate_vars().
  2. The column types are not generally known which is why allow_predicates would make sense: Optionally suppress use of predicates #226

The second point is still a bit annoying when trying to do some general work in a generic, e.g. in tidyr::nest() unnamed dots are tried to be named

tidyr::nest <- function (.data, ..., .names_sep = NULL, .key = deprecated()) {
  cols <- enquos(...)
  if (any(names2(cols) == "")) {
    col_names <- names(tidyselect::eval_select(expr(c(...)), .data))
    ...
  }
  UseMethod("nest")
}

So, it would be necessary to check the type to figure out whether allow_predicate should be TRUE or FALSE. It might make sense if tidyselect() could handle this.

Also see tidyverse/tidyr#1134

@hadley
Copy link
Member

hadley commented Aug 23, 2021

Note that there are at least two lazy tibble variants, one in dbplyr and the other in dtplyr.

@lionel- lionel- added the feature a feature request or enhancement label Mar 3, 2022
@hadley
Copy link
Member

hadley commented Aug 12, 2022

One possibility would be to provide a tidyselect_proxy generic. It could return list(data, supports_predicates).

@hadley hadley added this to the next milestone Aug 13, 2022
@hadley
Copy link
Member

hadley commented Sep 7, 2022

Better to do tidyselect_proxy() + tidyselect_supports_predicates().

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

Successfully merging a pull request may close this issue.

3 participants