@@ -232,14 +232,8 @@ Future <- function(expr = NULL, envir = parent.frame(), substitute = TRUE, stdou
232232 for (key in args_names ) core [[key ]] <- args [[key ]]
233233
234234 # # Backward compatibility: drop field 'envir' in future (>= 1.69.0)
235- # # 1. civis::CivisFuture() relies on 'envir'
236- # # 2. there might be other unknown dependencies out there => option
237235 if (getOption(" future.Future.envir.keep" , FALSE )) {
238236 core [[" envir" ]] <- envir
239- } else if (all(c(" required_resources" , " docker_image_name" ,
240- " docker_image_tag" ) %in% args_names ) && " civis" %in% loadedNamespaces()) {
241- # # Looks like Future() was called from CivisFuture
242- core [[" envir" ]] <- envir
243237 }
244238
245239 structure(core , class = c(" Future" , class(core )))
@@ -604,7 +598,6 @@ run.Future <- function(future, ...) {
604598 args <- list (
605599 quote(future [[" expr" ]]),
606600 substitute = FALSE ,
607- envir = future [[" envir" ]], # # For backward compatibility with 'civis'
608601 lazy = TRUE ,
609602 stdout = future [[" stdout" ]],
610603 conditions = future [[" conditions" ]],
@@ -616,6 +609,11 @@ run.Future <- function(future, ...) {
616609 calls = future [[" calls" ]]
617610 )
618611
612+ # # For backward compatibility since future (>= 1.69.0)
613+ if (" envir" %in% names(future )) {
614+ args [[" envir" ]] <- future [[" envir" ]]
615+ }
616+
619617 # # SPECIAL: 'cluster' takes argument 'persistent' for now /HB 2023-01-17
620618 has_persistent <- (" persistent" %in% names(future ))
621619 if (has_persistent ) args [[" persistent" ]] <- future [[" persistent" ]]
0 commit comments