Closed saadaslam closed 4 years ago
After some more debugging, it turns out that this is due to problematic subsequent dynamic targets where one of the inputs is an empty list and you're using cross
So basically, here's a reprex:
library(drake)
the_plan <- drake_plan(
cars_split = split(mtcars, mtcars$cyl),
model_1 = target(
lm(mpg ~ wt, data = cars_split[[1]]),
dynamic = map(cars_split)
),
link_f = c("logit", "probit"),
## cars_split_400 will be an empty list
cars_split_400 = Filter(function(x) x$hp >= 400, cars_split),
model_2 = target(
glm(am ~ wt, data = cars_split_400, family = binomial(link = link_f)),
dynamic = cross(link_f, cars_split_400)
)
)
make(the_plan)
#> ▶ target link_f
#> ▶ target cars_split
#> ▶ target cars_split_400
#> ▶ dynamic model_1
#> > subtarget model_1_e80834f2
#> > subtarget model_1_13ddb898
#> > subtarget model_1_b975270d
#> ■ finalize model_1
#> Error in FUN(X[[i]], ...): size > 0L is not TRUE
Created on 2020-08-11 by the reprex package (v0.3.0)
I am closing this because it's not a bug, although a more useful error message would be helpful. For example, telling me that the error came from drake
and not some other procedure in my program.
An improved error message sounds reasonable. Just added one in 00183e118b3efa29e327e7241f797c14aa423744.
I can't necessarily reproduce the issue with ease, and this is for a project I can't share, but I'm running into this error while running
make
:This seems to occur after
make
finishes compiling a dynamic target. Afterwards, the error above occurs.I've experimented with this a couple times and have found that:
loadd
orreadd
make
again, subsequent dependent targets are kicked off and in the process of being created, although the same error above occurs for dynamic targetsmake
, eventually, I only get the error described above.Unfortunately, the error persists after numerous attempts running
clean()
,clean(destroy=TRUE)
, and even re-installing drake. I have also attempted to force targets to be lists viatarget(..., subtarget_list = TRUE)
Here's the traceback()
And here's the
sessionInfo()