-
Notifications
You must be signed in to change notification settings - Fork 129
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
cache$import() corrupts fst and data.frame targets #1120
Comments
As an aside, this is unexpected:
How did it become a |
Well that's insidious and embarrassing. Thanks for catching it. Fixed in 81fe55b. |
Apparently #1120 (comment) happened because make(plan)
#> target data # starts off as a data frame
#> target data_disk # as.disk.frame() changes data to a data.table
#> target data_fst # data is now a data.table. I guess this makes sense because it is memory efficient, but it is a side effect I did not expect, and it violates library(drake)
suppressPackageStartupMessages(library(disk.frame))
cache1 <- new_cache(path = tempfile())
plan <- drake_plan(
data = data.frame(
x = runif(1000),
y = runif(1000)
),
data_fst = target(
data,
format = "fst"
),
data_disk = target(
as.disk.frame(
rlang::duplicate(data), # Duplicate the data to avoid corrupting the target.
outdir = drake_tempfile(cache = cache1)
),
format = "diskframe"
)
)
make(plan, cache = cache1)
#> target data
#> target data_disk
#> target data_fst Created on 2019-12-19 by the reprex package (v0.3.0) |
Sounds like an issue I contributed to. Just leaving a note here: I think |
It's okay, glad you are aware now. |
Prework
drake
's code of conduct.remotes::install_github("ropensci/drake")
) and mention the SHA-1 hash of the Git commit you install.using 36861bf
Description
When importing a target that was stored using
format = "fst"
orformat = "diskframe"
, the stored object in the original cache is corrupted. Forfst
, the copy in the new cache is ok. Fordiskframe
, both versions are corrupted.Reproducible example
Created on 2019-12-19 by the reprex package (v0.3.0)
Session info
Expected result
Both caches should have working copies of the targets.
The text was updated successfully, but these errors were encountered: