Changes to the cache API required by the new reticulate cache implementation#2170
Open
leogama wants to merge 23 commits intoyihui:masterfrom
Open
Changes to the cache API required by the new reticulate cache implementation#2170leogama wants to merge 23 commits intoyihui:masterfrom
reticulate cache implementation#2170leogama wants to merge 23 commits intoyihui:masterfrom
Conversation
Author
|
|
…ays be invalidated
Author
|
Updated: The last commit should work with rstudio/reticulate@a33ed39 and uqfoundation/dill@4244d3b |
…a dir if it exists)
… of full `options`
yihui
approved these changes
Sep 27, 2022
Owner
yihui
left a comment
There was a problem hiding this comment.
Looks good over all. I'll make a few cosmetic changes and merge later. Thank you!
R/cache.R
Outdated
| cache_purge = function(hash) { | ||
| for (h in hash) unlink(paste(cache_path(h), c('rdb', 'rdx', 'RData'), sep = '.')) | ||
| cache_purge = function(glob_path) { | ||
| unlink(paste(glob_path, c('rdb', 'rdx', 'RData'), sep = '.')) |
Owner
There was a problem hiding this comment.
Note that glob_path could be a vector of length > 1, so we still need to purge them one by one via a loop.
Conflicts: NEWS.md [ci skip]
Owner
|
Oh actually since the API has changed, we need to update the documentation accordingly: Lines 35 to 51 in 6bfffe9 Could you please also do that? Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As we discussed in rstudio/reticulate#1210 (comment), these changes use the same interface for the cache of external engines as the R cache interface. Relevant changes for non-R chunks:
cache_enginesstores cache importer functions that, upon call, return "cache objects", i.e. lists with functions as items (exists,load,save,purge, etc.)knit()call's working directoryexists()) and purges are done for R cache and external cache together for consistencyPlus a bug fix: always check for
.RDatafiles (which stores the output in lazy cache mode if I understood it right).@yihui You may review this PR right away, but let's hold the merge while I'm still implementing and testing the
reticulatePR.