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

unnest_longer(), unnest_wider(), and hoist() should check that first argument is a data frame #1224

Closed
mgirlich opened this issue Nov 16, 2021 · 0 comments · Fixed by #1226
Closed

Comments

@mgirlich
Copy link
Contributor

This would give much better error messages when the user assumes that these functions work for lazy tables. Currently, the error messages do not help much:

library(tidyr)
library(dtplyr)

df <- tibble(
  x = 1:3,
  y = list(NULL, 1:3, 4:5)
) %>% 
  lazy_dt()

df %>% 
  hoist(y)
#> Error: object 'y' not found

df %>% 
  unnest_longer(y)
#> Error: `x` must be a vector, not a <dtplyr_step_first/dtplyr_step> object.

Created on 2021-11-16 by the reprex package (v2.0.1)

Alternatively, these functions could be made generic (see #1071).

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 a pull request may close this issue.

1 participant