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

Fix load_from_disk temporary directory #3245

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Nov 9, 2021

load_from_disk uses tempfile.TemporaryDirectory() instead of our get_temporary_cache_files_directory() function. This can cause the temporary directory to be deleted before the dataset object is garbage collected.

In practice, it prevents anyone from using methods like shuffle on a dataset loaded this way, because it can't write the shuffled indices in a directory that doesn't exist anymore.

In this PR I switch to using get_temporary_cache_files_directory() and I update the tests.

cc @mariosasko since you worked on get_temporary_cache_files_directory()

@lhoestq lhoestq merged commit 709b32f into master Nov 9, 2021
@lhoestq lhoestq deleted the fix-load_from_disk-temp-dir branch November 9, 2021 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant