HenrikBengtsson / future

:rocket: R package: future: Unified Parallel and Distributed Processing in R for Everyone
https://future.futureverse.org
951 stars 83 forks source link

Warning: Error in add_months: could not find function "add_months" #626

Closed kyle-power closed 2 years ago

kyle-power commented 2 years ago

Describe the bug

My future calls have recently started to error, and seem unable to access functions directly. For example, within my future expression I have the following line

start_date_prev1 <- start_date %>% clock::add_years(n = prev1, invalid = "previous") %>% clock::add_months(n = -1L, invalid = "previous")

Clearly, I am explicitly defining the function using ::, so why so I keep getting the following error:

Warning: Error in add_months: could not find function "add_months"

Session information

Please share your session information after the error has occurred so that we also see which packages and versions are involved;

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] shiny_1.7.1      beast_0.0.0.9000

loaded via a namespace (and not attached):
  [1] colorspace_2.0-3   ellipsis_0.3.2     rprojroot_2.0.3    fs_1.5.2           rstudioapi_0.13    roxygen2_7.2.0     listenv_0.8.0      remotes_2.4.2     
  [9] DT_0.23            bit64_4.0.5        golem_0.3.2        fansi_1.0.3        lubridate_1.8.0    xml2_1.3.3         codetools_0.2-18   cachem_1.0.6      
 [17] knitr_1.39         config_0.3.1       pkgload_1.2.4      jsonlite_1.8.0     gt_0.6.0           rJava_1.0-6        readr_2.1.2        compiler_4.1.2    
 [25] httr_1.4.3         assertthat_0.2.1   fastmap_1.1.0      lazyeval_0.2.2     cli_3.3.0          later_1.3.0        htmltools_0.5.2    prettyunits_1.1.1 
 [33] tools_4.1.2        gtable_0.3.0       glue_1.6.2         dplyr_1.0.9        Rcpp_1.0.8.3       jquerylib_0.1.4    vctrs_0.4.1        blastula_0.3.2    
 [41] xfun_0.31          stringr_1.4.0      globals_0.15.0     ps_1.7.0           brio_1.1.3         openxlsx_4.2.5     testthat_3.1.4     mime_0.12         
 [49] lifecycle_1.0.1    devtools_2.4.3     future_1.25.0      waiter_0.2.5       odbc_1.3.3         scales_1.2.0       hms_1.1.1          promises_1.2.0.1  
 [57] parallel_4.1.2     yaml_2.3.5         shiny.fluent_0.2.0 curl_4.3.2         memoise_2.0.1      geosphere_1.5-14   jose_1.2.0         ggplot2_3.3.6     
 [65] sass_0.4.1         stringi_1.7.6      desc_1.4.1         clock_0.6.0        pkgbuild_1.3.1     zip_2.2.0          attempt_0.3.1      multidplyr_0.1.1  
 [73] rlang_1.0.2        pkgconfig_2.0.3    shiny.react_0.2.3  lattice_0.20-45    fontawesome_0.2.2  purrr_0.3.4        htmlwidgets_1.5.4  bit_4.0.4         
 [81] processx_3.5.3     tidyselect_1.1.2   parallelly_1.31.1  magrittr_2.0.3     shiny.router_0.2.2 R6_2.5.1           generics_0.1.2     DBI_1.1.2         
 [89] pillar_1.7.0       withr_2.5.0        sp_1.4-7           tibble_3.1.7       crayon_1.5.1       uuid_1.1-0         utf8_1.2.2         plotly_4.10.0     
 [97] tzdb_0.3.0         officer_0.4.2      RJDBC_0.2-10       usethis_2.1.5      grid_4.1.2         data.table_1.14.2  blob_1.2.3         callr_3.7.0       
[105] digest_0.6.29      xtable_1.8-4       tidyr_1.2.0        httpuv_1.6.5       openssl_2.0.2      pool_0.1.6         munsell_0.5.0      viridisLite_0.4.0 
[113] bslib_0.3.1        sessioninfo_1.2.2  askpass_1.1        shinyjs_2.1.0
…
> future::futureSessionInfo()
*** Package versions
future 1.25.0, parallelly 1.31.1, parallel 4.1.2, globals 0.15.0, listenv 0.8.0

*** Allocations
availableCores():
system 
     8 
availableWorkers():
$system
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

*** Settings
- future.plan=<not set>
- future.fork.multithreading.enable=<not set>
- future.globals.maxSize=1048576000
- future.globals.onReference=<not set>
- future.resolve.recursive=<not set>
- future.rng.onMisuse=<not set>
- future.wait.timeout=<not set>
- future.wait.interval=<not set>
- future.wait.alpha=<not set>
- future.startup.script=<not set>

*** Backends
Number of workers: 6
List of future strategies:
1. multisession:
   - args: function (..., workers = 6, envir = parent.frame())
   - tweaked: TRUE
   - call: plan(strategy = multisession, workers = 6)

*** Basic tests
  worker   pid     r sysname release     version    nodename machine  login   user effective_user
1      1  8924 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
2      2 16628 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
3      3 10188 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
4      4  1860 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
5      5  7520 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
6      6  9940 4.1.2 Windows  10 x64 build 18363 QXL07317413  x86-64 735103 735103         735103
Number of unique PIDs: 6 (as expected)
…