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

When one column missing in new_data that is used in recipe, bake() fails uniformatively #491

Closed
lorenzwalthert opened this issue Apr 7, 2020 · 3 comments · Fixed by #865
Assignees
Labels
feature a feature request or enhancement

Comments

@lorenzwalthert
Copy link
Contributor

lorenzwalthert commented Apr 7, 2020

Can we fail more informatively here?

library(recipes)
#> Loading required package: dplyr
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
#> 
#> Attaching package: 'recipes'
#> The following object is masked from 'package:stats':
#> 
#>     step
library(datasets)
rec <- recipe(event ~ ., data = attenu) %>%
  step_integer(station)
prepped <- prep(rec)
bake(prepped, attenu %>% dplyr::select(-.data$station))
#> Error: Can't join on 'value' x 'value' because of incompatible types (character / NULL)

Created on 2020-04-07 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Ubuntu 18.04.4 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Europe/Zurich               
#>  date     2020-04-07                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date       lib source        
#>  assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.1)
#>  backports     1.1.5      2019-10-02 [1] CRAN (R 3.6.1)
#>  callr         3.4.2      2020-02-12 [1] CRAN (R 3.6.3)
#>  class         7.3-16     2020-03-25 [4] CRAN (R 3.6.3)
#>  cli           2.0.2      2020-02-28 [1] CRAN (R 3.6.3)
#>  crayon        1.3.4      2017-09-16 [1] CRAN (R 3.6.1)
#>  desc          1.2.0      2018-05-01 [1] CRAN (R 3.6.1)
#>  devtools      2.2.2      2020-02-17 [1] CRAN (R 3.6.3)
#>  digest        0.6.25     2020-02-23 [1] CRAN (R 3.6.3)
#>  dplyr       * 0.8.5      2020-03-07 [1] CRAN (R 3.6.3)
#>  ellipsis      0.3.0      2019-09-20 [1] CRAN (R 3.6.1)
#>  evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.1)
#>  fansi         0.4.1      2020-01-08 [1] CRAN (R 3.6.1)
#>  fs            1.4.1      2020-04-04 [1] CRAN (R 3.6.3)
#>  generics      0.0.2      2018-11-29 [1] CRAN (R 3.6.1)
#>  glue          1.4.0      2020-04-03 [1] CRAN (R 3.6.3)
#>  gower         0.2.1      2019-05-14 [1] CRAN (R 3.6.2)
#>  highr         0.8        2019-03-20 [1] CRAN (R 3.6.1)
#>  htmltools     0.4.0      2019-10-04 [1] CRAN (R 3.6.1)
#>  ipred         0.9-9      2019-04-28 [1] CRAN (R 3.6.2)
#>  knitr         1.28       2020-02-06 [1] CRAN (R 3.6.3)
#>  lattice       0.20-40    2020-02-19 [4] CRAN (R 3.6.2)
#>  lava          1.6.7      2020-03-05 [1] CRAN (R 3.6.3)
#>  lifecycle     0.2.0      2020-03-06 [1] CRAN (R 3.6.3)
#>  lubridate     1.7.4      2018-04-11 [1] CRAN (R 3.6.1)
#>  magrittr    * 1.5        2014-11-22 [1] CRAN (R 3.6.1)
#>  MASS          7.3-51.5   2019-12-20 [4] CRAN (R 3.6.2)
#>  Matrix        1.2-18     2019-11-27 [4] CRAN (R 3.6.1)
#>  memoise       1.1.0      2017-04-21 [1] CRAN (R 3.6.1)
#>  nnet          7.3-13     2020-02-25 [4] CRAN (R 3.6.3)
#>  pillar        1.4.3      2019-12-20 [1] CRAN (R 3.6.1)
#>  pkgbuild      1.0.6      2019-10-09 [1] CRAN (R 3.6.1)
#>  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 3.6.1)
#>  pkgload       1.0.2      2018-10-29 [1] CRAN (R 3.6.1)
#>  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 3.6.2)
#>  processx      3.4.2      2020-02-09 [1] CRAN (R 3.6.3)
#>  prodlim       2019.11.13 2019-11-17 [1] CRAN (R 3.6.2)
#>  ps            1.3.2      2020-02-13 [1] CRAN (R 3.6.3)
#>  purrr         0.3.3      2019-10-18 [1] CRAN (R 3.6.1)
#>  R6            2.4.1      2019-11-12 [1] CRAN (R 3.6.1)
#>  Rcpp          1.0.4      2020-03-17 [1] CRAN (R 3.6.3)
#>  recipes     * 0.1.10     2020-03-18 [1] CRAN (R 3.6.3)
#>  remotes       2.1.1      2020-02-15 [1] CRAN (R 3.6.3)
#>  rlang         0.4.5      2020-03-01 [1] CRAN (R 3.6.3)
#>  rmarkdown     2.1        2020-01-20 [1] CRAN (R 3.6.3)
#>  rpart         4.1-15     2019-04-12 [4] CRAN (R 3.6.1)
#>  rprojroot     1.3-2      2018-01-03 [1] CRAN (R 3.6.1)
#>  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.1)
#>  stringi       1.4.6      2020-02-17 [1] CRAN (R 3.6.3)
#>  stringr       1.4.0      2019-02-10 [1] CRAN (R 3.6.1)
#>  survival      3.1-11     2020-03-07 [4] CRAN (R 3.6.3)
#>  testthat      2.3.2      2020-03-02 [1] CRAN (R 3.6.3)
#>  tibble        3.0.0      2020-03-30 [1] CRAN (R 3.6.3)
#>  tidyr         1.0.2      2020-01-24 [1] CRAN (R 3.6.3)
#>  tidyselect    1.0.0      2020-01-27 [1] CRAN (R 3.6.3)
#>  timeDate      3043.102   2018-02-21 [1] CRAN (R 3.6.2)
#>  usethis     * 1.5.1      2019-07-04 [1] CRAN (R 3.6.1)
#>  vctrs         0.2.4      2020-03-10 [1] CRAN (R 3.6.3)
#>  withr         2.1.2      2018-03-15 [1] CRAN (R 3.6.3)
#>  xfun          0.12       2020-01-13 [1] CRAN (R 3.6.2)
#>  yaml          2.2.1      2020-02-01 [1] CRAN (R 3.6.3)
#> 
#> [1] /home/walor/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library
@lorenzwalthert
Copy link
Contributor Author

Thanks Max.

@lorenzwalthert
Copy link
Contributor Author

And Emil :D.

@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants