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

repro example does not work #224

Closed
samlipworth opened this issue Mar 10, 2021 · 6 comments · Fixed by #225
Closed

repro example does not work #224

samlipworth opened this issue Mar 10, 2021 · 6 comments · Fixed by #225

Comments

@samlipworth
Copy link

library(data.table)
library(tidyverse)
library(dplyr)

mtcars2 <- lazy_dt(mtcars)
mtcars2 %>% 
  filter(wt < 5) %>% 
  mutate(l100k = 235.21 / mpg) %>% # liters / 100 km
  group_by(cyl) %>% 
  summarise(l100k = mean(l100k))

gives:
Error in env_get_list(ns_env("data.table"), dt_funs) :
argument "default" is missing, with no default

@samlipworth
Copy link
Author

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] dtplyr_1.1.0 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.5 purrr_0.3.4 readr_1.3.1 tidyr_1.1.0 tibble_3.0.3 ggplot2_3.3.2 tidyverse_1.3.0 data.table_1.12.8

loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 cellranger_1.1.0 pillar_1.4.6 compiler_4.0.2 dbplyr_1.4.4 tools_4.0.2 jsonlite_1.7.0 lubridate_1.7.9.9001 lifecycle_1.0.0 gtable_0.3.0
[11] pkgconfig_2.0.3 rlang_0.4.10 reprex_0.3.0 cli_2.0.2 DBI_1.1.0 rstudioapi_0.11 haven_2.3.1 withr_2.2.0 xml2_1.3.2 httr_1.4.1
[21] fs_1.4.2 generics_0.0.2 vctrs_0.3.6 hms_0.5.3 grid_4.0.2 tidyselect_1.1.0 glue_1.4.1 R6_2.4.1 fansi_0.4.1 readxl_1.3.1
[31] modelr_0.1.8 blob_1.2.1 magrittr_1.5 backports_1.1.8 scales_1.1.1 ellipsis_0.3.1 parallelDist_0.2.4 rvest_0.3.5 assertthat_0.2.1 colorspace_1.4-2
[41] stringi_1.4.6 RcppParallel_5.0.2 munsell_0.5.0 broom_0.7.0 crayon_1.3.4

@myoung3
Copy link

myoung3 commented Mar 11, 2021

I was able to reproduce this with data.table 1.12.8. For what it's worth, your code works starting in data.table 1.13.0 so upgrading data.table--if that's possible for your project--will fix this.

@myoung3
Copy link

myoung3 commented Mar 11, 2021

traceback in 1.12.8:

> traceback()
9: env_get_list(ns_env("data.table"), dt_funs)
8: list3(...)
7: env_bind(env, !!!env_get_list(ns_env("data.table"), dt_funs))
6: add_dt_wrappers(env)
5: dt_eval(x)
4: as.data.table.dtplyr_step(x)
3: as.data.table(x)
2: print.dtplyr_step(x)
1: (function (x, ...)
   UseMethod("print"))(x)

@hadley
Copy link
Member

hadley commented Mar 11, 2021

We should add 1.13.0 as a minimum version in the DESCRIPTION

@markfairbanks
Copy link
Collaborator

markfairbanks commented Mar 11, 2021

@hadley - I just added the minimum version bump to the PR for expand()

@samlipworth
Copy link
Author

great thanks both - does indeed work after data table update

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.

4 participants