Skip to content
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

get_cache doesn't actually get the cache at the path provided #883

Closed
3 tasks done
kendonB opened this issue May 26, 2019 · 2 comments
Closed
3 tasks done

get_cache doesn't actually get the cache at the path provided #883

kendonB opened this issue May 26, 2019 · 2 comments
Assignees

Comments

@kendonB
Copy link
Contributor

kendonB commented May 26, 2019

Prework

Description

get_cache finds .drake even when the exact path of an adjacent cache is given.

Reproducible example

library(drake)
cache = new_cache(".test")
test_plan = drake_plan(
  dot_test = 1
)
make(test_plan, cache = cache)
#> target dot_test
dr_plan = drake_plan(
  dot_drake = 1
)
make(dr_plan)
#> target dot_drake
# finds .drake
cached(cache = get_cache(".test"))
#> [1] "dot_drake"
# works
cached(cache = cache)
#> [1] "dot_test"
# works
cached(cache = this_cache(".test"))
#> Warning: this_cache() in drake is deprecated. Use get_cache() or
#> storr::storr_rds() instead.
#> [1] "dot_test"

Created on 2019-05-26 by the reprex package (v0.3.0)

Expected output

library(drake)
cache = new_cache(".test")
test_plan = drake_plan(
  dot_test = 1
)
make(test_plan, cache = cache)
#> target dot_test
dr_plan = drake_plan(
  dot_drake = 1
)
make(dr_plan)
#> target dot_drake
# works
cached(cache = get_cache(".test"))
#> [1] "dot_test"
# works
cached(cache = cache)
#> [1] "dot_test"
# works
cached(cache = this_cache(".test"))
#> Warning: this_cache() in drake is deprecated. Use get_cache() or
#> storr::storr_rds() instead.
#> [1] "dot_test"

Created on 2019-05-26 by the reprex package (v0.3.0)

@wlandau
Copy link
Member

wlandau commented May 26, 2019

Thanks for the nudge. I regret the awkward design of get_cache(), and I think we should deprecate it in favor of a better-behaved drake_cache() function. A PR is forthcoming.

@wlandau
Copy link
Member

wlandau commented May 26, 2019

Fixed via #884.

@wlandau wlandau closed this as completed May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants