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

Internal error in vec_assign() after #1200 #1203

Closed
hsbadr opened this issue May 12, 2021 · 3 comments
Closed

Internal error in vec_assign() after #1200 #1203

hsbadr opened this issue May 12, 2021 · 3 comments

Comments

@hsbadr
Copy link

hsbadr commented May 12, 2021

This affects many packages/functions. A few tests confirm that it's due to #1200. Probably, vctrs needs a patch for this. Here's a simple example:

library(baguette)
#> Loading required package: parsnip
#> Error: package or namespace load failed for 'baguette':
#>  .onLoad failed in loadNamespace() for 'baguette', details:
#>   call: NULL
#>   error: Internal error in `vec_assign()`: `value` should have been recycled to fit `x`.

Created on 2021-05-12 by the reprex package (v2.0.0.9000)

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                                             
#>  version  R Under development (unstable) (2021-05-12 r80284)
#>  os       Ubuntu 20.04.2 LTS                                
#>  system   x86_64, linux-gnu                                 
#>  ui       X11                                               
#>  language (EN)                                              
#>  collate  en_US.UTF-8                                       
#>  ctype    en_US.UTF-8                                       
#>  tz       America/New_York                                  
#>  date     2021-05-12                                        
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package       * version     date
#>  assertthat      0.2.1.9000  2021-04-23
#>  backports       1.2.1       2021-04-21
#>  C50             0.1.3.1     2020-05-26
#>  cli             2.5.0.9000  2021-05-11
#>  codetools       0.2-18      2020-11-04
#>  colorspace      2.0-1       2021-05-04
#>  crayon          1.4.1.9000  2021-04-26
#>  Cubist          0.2.40      2021-05-10
#>  DBI             1.1.1.9000  2021-04-26
#>  dials           0.0.9.9000  2021-04-26
#>  DiceDesign      1.9         2021-02-13
#>  digest          0.6.27.1    2021-04-20
#>  dplyr           1.0.6.9000  2021-05-06
#>  earth           5.3.0       2020-10-11
#>  ellipsis        0.3.2.9000  2021-04-29
#>  evaluate        0.14.1      2021-04-21
#>  fansi           0.4.2       2021-04-23
#>  fastmap         1.1.0       2021-04-22
#>  Formula         1.2-4       2020-10-16
#>  fs              1.5.0.9000  2021-04-22
#>  furrr           0.2.2.9000  2021-05-04
#>  future          1.21.0-9000 2021-05-12
#>  generics        0.1.0.9000  2021-04-22
#>  globals         0.14.0-9000 2021-04-21
#>  glue            1.4.2       2020-08-27
#>  hardhat         0.1.5.9000  2021-04-21
#>  highr           0.9.1       2021-04-23
#>  htmltools       0.5.1.9003  2021-05-06
#>  inum            1.0-4       2021-04-12
#>  knitr           1.33.4      2021-05-12
#>  lattice         0.21-2      2021-04-26
#>  libcoin         1.0-8       2021-02-08
#>  lifecycle       1.0.0.9000  2021-04-21
#>  listenv         0.8.0-9000  2021-04-21
#>  magrittr        2.0.1.9000  2021-04-21
#>  Matrix          1.3-3       2021-05-04
#>  munsell         0.5.0       2018-06-12
#>  mvtnorm         1.1-1       2020-06-09
#>  parallelly      1.25.0-9000 2021-05-01
#>  parsnip       * 0.1.5.9002  2021-05-11
#>  partykit        1.2-13      2021-03-03
#>  pillar          1.6.0.9001  2021-04-20
#>  pkgconfig       2.0.3       2021-04-22
#>  plotmo          3.6.0       2020-09-13
#>  plotrix         3.8-1       2021-01-21
#>  plyr            1.8.6       2020-03-03
#>  purrr           0.3.4.9000  2021-04-21
#>  R6              2.5.0.9000  2021-04-21
#>  Rcpp            1.0.6.6     2021-05-07
#>  reprex          2.0.0.9000  2021-04-21
#>  reshape2        1.4.4       2020-04-09
#>  rlang           0.4.11.9000 2021-05-12
#>  rmarkdown       2.8.1       2021-05-12
#>  rpart           4.1-15      2019-04-12
#>  rsample         0.1.0.9000  2021-05-08
#>  scales          1.1.1.9000  2021-04-21
#>  sessioninfo     1.1.1.9000  2021-04-22
#>  stringi         1.6.2       2021-05-11
#>  stringr         1.4.0.9000  2021-05-03
#>  styler          1.4.1.9003  2021-05-07
#>  survival        3.2-10      2021-03-16
#>  TeachingDemos   2.12        2020-04-07
#>  tibble          3.1.1.9000  2021-04-20
#>  tidyr           1.1.3.9000  2021-04-21
#>  tidyselect      1.1.1.9000  2021-04-30
#>  utf8            1.2.1.9000  2021-04-23
#>  vctrs           0.3.8.9000  2021-05-12
#>  withr           2.4.2       2021-04-21
#>  xfun            0.22.3      2021-05-11
#>  yaml            2.2.1.99    2021-04-23
@hsbadr
Copy link
Author

hsbadr commented May 12, 2021

Here's the traceback for the example:

6: stop(msg, call. = FALSE, domain = NA)
5: value[[3L]](cond)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
3: tryCatchList(expr, classes, parentenv, handlers)
2: tryCatch({
       attr(package, "LibPath") <- which.lib.loc
       ns <- loadNamespace(package, lib.loc)
       env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
   }, error = function(e) {
       P <- if (!is.null(cc <- conditionCall(e)))
           paste(" in", deparse(cc)[1L])
       else ""
       msg <- gettextf("package or namespace load failed for %s%s:\n %s",
           sQuote(package), P, conditionMessage(e))
       if (logical.return)
           message(paste("Error:", msg), domain = NA)
       else stop(msg, call. = FALSE, domain = NA)
   })
1: library(baguette)

@hsbadr
Copy link
Author

hsbadr commented May 12, 2021

@lionel- Does this require restoring the default behavior with .named = FALSE while allowing .named = NULL?

@lionel-
Copy link
Member

lionel- commented May 12, 2021

There should be no behaviour change here, so there is something wrong, thanks for the report.

Does this require restoring the default behavior with .named = FALSE while allowing .named = NULL?

It's more complicated than that because we previously interpreted .named differently based on the context. The linked PR is an attempt at making the behaviour explicit.

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

No branches or pull requests

2 participants