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

Can non-dynamic dependencies of dynamic targets be saved with special data formats? #1210

Closed
3 tasks done
psadil opened this issue Mar 10, 2020 · 1 comment
Closed
3 tasks done

Comments

@psadil
Copy link

psadil commented Mar 10, 2020

Prework

  • Read and abide by drake's code of conduct.
  • Search for duplicates among the existing issues, both open and closed.
  • If you think your issue has a quick and definite solution, consider posting to Stack Overflow under the drake-r-package tag. (If you anticipate extended follow-up and discussion, you are already in the right place!)

Hello!

Description

Is there a special way to mix the format = ... option with dynamic targets? In the example below, I'm getting an error when a dependency (numbers) of a dynamic target (again) is stored with format = "qs", but only when the dependency is not itself a dynamic target.

Reproducible example

library(drake)

plan <- drake_plan(
  numbers = target(
    seq_len(2), 
    format = "qs"),
  again = target(
    numbers))
make(plan)
#> ▶ target numbers
#> ▶ target again

clean(destroy = TRUE)

plan <- drake_plan(
  numbers = target(
    seq_len(2), 
    format = "qs"),
  again = target(
    numbers,
    dynamic = map(numbers)))
make(plan)
#> ▶ target numbers
#> Error: Input must be a vector, not a `drake_format_qs/drake_format` object.

clean(destroy = TRUE)

plan <- drake_plan(
  numbers = target(
    seq_len(2)),
  again = target(
    numbers,
    dynamic = map(numbers)))
make(plan)
#> ▶ target numbers
#> ▶ dynamic again
#> > subtarget again_0b3474bd
#> > subtarget again_b2a5c9b8
#> ■ finalize again

clean(destroy = TRUE)

plan <- drake_plan(
  initial = target(
    seq_len(2)),
  numbers = target(
    initial,
    dynamic = map(initial),
    format = "qs"),
  again = target(
    numbers,
    dynamic = map(numbers)))
make(plan)
#> ▶ target initial
#> ▶ dynamic numbers
#> > subtarget numbers_0b3474bd
#> > subtarget numbers_b2a5c9b8
#> ■ finalize numbers
#> ▶ dynamic again
#> > subtarget again_44fc887c
#> > subtarget again_ae868dc2
#> ■ finalize again

Created on 2020-03-10 by the reprex package (v0.3.0)

Desired result

I expected all three plans to finish, with again being the same in each.

Session Info

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  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       America/New_York            
#>  date     2020-03-10                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package       * version     date       lib source                         
#>  assertthat      0.2.1       2019-03-21 [1] CRAN (R 3.6.0)                 
#>  backports       1.1.5       2019-10-02 [1] CRAN (R 3.6.1)                 
#>  base64url       1.4         2018-05-14 [1] CRAN (R 3.6.0)                 
#>  callr           3.4.2       2020-02-12 [1] CRAN (R 3.6.1)                 
#>  cli             2.0.2       2020-02-28 [1] CRAN (R 3.6.1)                 
#>  crayon          1.3.4       2017-09-16 [1] CRAN (R 3.6.0)                 
#>  desc            1.2.0       2018-05-01 [1] CRAN (R 3.6.0)                 
#>  devtools        2.2.2       2020-02-17 [1] CRAN (R 3.6.1)                 
#>  digest          0.6.25      2020-02-23 [1] CRAN (R 3.6.1)                 
#>  drake         * 7.11.0.9000 2020-03-10 [1] Github (ropensci/drake@e3ef6c9)
#>  ellipsis        0.3.0       2019-09-20 [1] CRAN (R 3.6.1)                 
#>  evaluate        0.14        2019-05-28 [1] CRAN (R 3.6.0)                 
#>  fansi           0.4.1       2020-01-08 [1] CRAN (R 3.6.1)                 
#>  filelock        1.0.2       2018-10-05 [1] CRAN (R 3.6.1)                 
#>  fs              1.3.2       2020-03-05 [1] CRAN (R 3.6.1)                 
#>  glue            1.3.1       2019-03-12 [1] CRAN (R 3.6.0)                 
#>  highr           0.8         2019-03-20 [1] CRAN (R 3.6.0)                 
#>  hms             0.5.3       2020-01-08 [1] CRAN (R 3.6.1)                 
#>  htmltools       0.4.0       2019-10-04 [1] CRAN (R 3.6.1)                 
#>  igraph          1.2.4.2     2019-11-27 [1] CRAN (R 3.6.1)                 
#>  knitr           1.28        2020-02-06 [1] CRAN (R 3.6.1)                 
#>  magrittr        1.5         2014-11-22 [1] CRAN (R 3.6.0)                 
#>  memoise         1.1.0       2017-04-21 [1] CRAN (R 3.6.0)                 
#>  pillar          1.4.3       2019-12-20 [1] CRAN (R 3.6.1)                 
#>  pkgbuild        1.0.6       2019-10-09 [1] standard (@1.0.6)              
#>  pkgconfig       2.0.3       2019-09-22 [1] standard (@2.0.3)              
#>  pkgload         1.0.2       2018-10-29 [1] CRAN (R 3.6.0)                 
#>  prettyunits     1.1.1       2020-01-24 [1] CRAN (R 3.6.1)                 
#>  processx        3.4.2       2020-02-09 [1] CRAN (R 3.6.1)                 
#>  progress        1.2.2       2019-05-16 [1] CRAN (R 3.6.0)                 
#>  ps              1.3.2       2020-02-13 [1] CRAN (R 3.6.1)                 
#>  qs              0.21.2      2020-03-10 [1] CRAN (R 3.6.1)                 
#>  R6              2.4.1       2019-11-12 [1] CRAN (R 3.6.1)                 
#>  RApiSerialize   0.1.0       2014-04-19 [1] CRAN (R 3.6.1)                 
#>  Rcpp            1.0.3       2019-11-08 [1] standard (@1.0.3)              
#>  remotes         2.1.1       2020-02-15 [1] CRAN (R 3.6.1)                 
#>  rlang           0.4.5       2020-03-01 [1] CRAN (R 3.6.1)                 
#>  rmarkdown       2.1         2020-01-20 [1] CRAN (R 3.6.1)                 
#>  rprojroot       1.3-2       2018-01-03 [1] CRAN (R 3.6.0)                 
#>  sessioninfo     1.1.1       2018-11-05 [1] CRAN (R 3.6.0)                 
#>  storr           1.2.1       2018-10-18 [1] CRAN (R 3.6.0)                 
#>  stringi         1.4.6       2020-02-17 [1] CRAN (R 3.6.1)                 
#>  stringr         1.4.0       2019-02-10 [1] CRAN (R 3.6.0)                 
#>  testthat        2.3.2       2020-03-02 [1] CRAN (R 3.6.1)                 
#>  tibble          2.1.3       2019-06-06 [1] CRAN (R 3.6.0)                 
#>  txtq            0.2.0       2019-10-15 [1] CRAN (R 3.6.1)                 
#>  usethis         1.5.1       2019-07-04 [1] CRAN (R 3.6.0)                 
#>  vctrs           0.2.4       2020-03-10 [1] CRAN (R 3.6.1)                 
#>  withr           2.1.2       2018-03-15 [1] CRAN (R 3.6.0)                 
#>  xfun            0.12        2020-01-13 [1] CRAN (R 3.6.1)                 
#>  yaml            2.2.1       2020-02-01 [1] CRAN (R 3.6.1)                 
#> 
#> [1] /home/psadil/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
@wlandau
Copy link
Member

wlandau commented Mar 10, 2020

That's certainly not supposed to happen. Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants