-
Notifications
You must be signed in to change notification settings - Fork 18
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
future.globals does not seem to work when variables are "created" in the named list #10
Comments
Seems to not be a problem with pure futures library(future.apply)
#> Loading required package: future
#>
#> Attaching package: 'future.apply'
#> The following object is masked from 'package:future':
#>
#> future_lapply
plan(sequential)
value(future({y}, globals = list(y = 4)))
#> [1] 4
value(future(
expr = { lapply(1, function(x) {y}) },
globals = list(y = 4)
))
#> [[1]]
#> [1] 4 Created on 2018-05-09 by the reprex package (v0.2.0). |
Thxs. Here's an example of the problem using plain futures: > library(future)
> plan(sequential)
> f <- futureCall(function(x) y, args = list(x = 1), future.globals = list(y = 3))
> value(f)
Error in (function (x) : object 'y' not found It'll be solved over at futureverse/future#225. Closing this one. |
My |
FYI this affects library(future.apply)
plan(multicore)
future_lapply(
X = 1,
FUN = function(x) {y},
future.globals = list(y = 4)
)
#> Error in ...future.FUN(...future.X_jj, ...): object 'y' not found
plan(multisession)
future_lapply(
X = 1,
FUN = function(x) {y},
future.globals = list(y = 4)
)
#> [[1]]
#> [1] 4 Created on 2018-05-14 by the reprex package (v0.2.0). |
Turns out that I just fixed this in future (>= 1.21.0-9003) in futureverse/future@6a87881, cf. futureverse/future#515. |
Kind of an obscure issue but definitely an issue:
Created on 2018-05-09 by the reprex package (v0.2.0).
Interestingly, the
y
value is recognized as a global, and makes it into the environment that the expression is evaluated in. You can see this by debugging and making your way to this line ofrun.UniprocessFuture()
. Not sure why it can't be seen inside the lapply() after thatThe text was updated successfully, but these errors were encountered: