Skip to content

package:rvest may not be available when loading #513

@SimonCoulombe

Description

@SimonCoulombe

Describe the bug
When trying to apply rvest::read_html() using furrr::future_map() I get and error.
I do not get that error when using purrr::map()

Reproduce example



library(rvest)
library(tidyverse)
library(furrr)
library(purrr)
plan("multisession", workers = 6)
#100000 to 413541


liste <- seq(100000, 100005)


# this works
z <- purrr::map(liste, 
                       function(x){ 
                         message(x)
                         read_html(paste0("https://www.ville.quebec.qc.ca/citoyens/taxes_evaluation/evaluation_fonciere/role/index.aspx?idfid=", x))
                         
                       }
)

# this doesnt 
options(future.globals.onReference = "error")
z <- furrr::future_map(liste, 
                       function(x){ 
                         message(x)
                         read_html(paste0("https://www.ville.quebec.qc.ca/citoyens/taxes_evaluation/evaluation_fonciere/role/index.aspx?idfid=", x))
                         
                       }
)

# Error: Detected a non-exportable reference (‘externalptr’) in one of the globals (<unknown>) used in the future expression
# In addition: Warning messages:
#   1: In serialize(x, connection = con, ascii = FALSE, xdr = FALSE, refhook = refhook) :
#   'package:rvest' may not be available when loading
# 2: In serialize(x, connection = con, ascii = FALSE, xdr = FALSE, refhook = refhook) :
#   'package:rvest' may not be available when loading
# 3: In serialize(x, connection = con, ascii = FALSE, xdr = FALSE, refhook = refhook) :
#   'package:rvest' may not be available when loading
# Timing stopped at: 0.048 0 0.049

Expected behavior
I'd expect to get the same result as with purrr::map()

Session information

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

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

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

other attached packages:
 [1] furrr_0.2.2     future_1.21.0   forcats_0.5.1   stringr_1.4.0   dplyr_1.0.6     purrr_0.3.4     readr_1.4.0     tidyr_1.1.3     tibble_3.1.2    ggplot2_3.3.3   tidyverse_1.3.1 rvest_1.0.0     testthat_3.0.2  devtools_2.4.2  usethis_2.0.1  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        lubridate_1.7.10  listenv_0.8.0     prettyunits_1.1.1 ps_1.6.0          assertthat_0.2.1  rprojroot_2.0.2   digest_0.6.27     utf8_1.2.1        parallelly_1.26.0 cellranger_1.1.0  R6_2.5.0          backports_1.2.1   reprex_2.0.0     
[15] httr_1.4.2        pillar_1.6.1      rlang_0.4.11      curl_4.3.1        readxl_1.3.1      rstudioapi_0.13   callr_3.7.0       desc_1.3.0        munsell_0.5.0     broom_0.7.7       compiler_4.1.0    modelr_0.1.8      pkgconfig_2.0.3   pkgbuild_1.2.0   
[29] globals_0.14.0    tidyselect_1.1.1  codetools_0.2-18  fansi_0.5.0       crayon_1.4.1      dbplyr_2.1.1      withr_2.4.2       grid_4.1.0        jsonlite_1.7.2    gtable_0.3.0      lifecycle_1.0.0   DBI_1.1.1         magrittr_2.0.1    scales_1.1.1     
[43] stringi_1.6.2     cli_2.5.0         cachem_1.0.5      fs_1.5.0          remotes_2.4.0     xml2_1.3.2        ellipsis_0.3.2    generics_0.1.0    vctrs_0.3.8       tools_4.1.0       glue_1.4.2        hms_1.1.0         processx_3.5.2    pkgload_1.2.1    
[57] parallel_4.1.0    fastmap_1.1.0     colorspace_2.0-1  sessioninfo_1.1.1 memoise_2.0.0     haven_2.4.1  

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions