From 00ef1179c012719a17c147a5c3b36d6bdbe97195 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Fri, 13 Nov 2020 12:13:06 -0800 Subject: [PATCH] [object spilling] Autocreate dir if not exists (#11999) --- python/ray/external_storage.py | 3 ++- python/ray/tests/test_object_spilling.py | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/python/ray/external_storage.py b/python/ray/external_storage.py index 825906328..45aeb2771 100644 --- a/python/ray/external_storage.py +++ b/python/ray/external_storage.py @@ -77,9 +77,10 @@ class FileSystemStorage(ExternalStorage): def __init__(self, directory_path): self.directory_path = directory_path self.prefix = "ray_spilled_object_" + os.makedirs(self.directory_path, exist_ok=True) if not os.path.exists(self.directory_path): raise ValueError("The given directory path to store objects, " - f"{self.directory_path}, doesn't exist.") + f"{self.directory_path}, could not be created.") def spill_objects(self, object_refs): keys = [] diff --git a/python/ray/tests/test_object_spilling.py b/python/ray/tests/test_object_spilling.py index 4cb5b0723..22bd3989e 100644 --- a/python/ray/tests/test_object_spilling.py +++ b/python/ray/tests/test_object_spilling.py @@ -107,13 +107,6 @@ def test_invalid_config_raises_exception(shutdown_only): "object_spilling_config": json.dumps(copied_config), }) - with pytest.raises(ValueError): - copied_config = copy.deepcopy(file_system_object_spilling_config) - copied_config["params"].update({"directory_path": "not_exist_path"}) - ray.init(_system_config={ - "object_spilling_config": json.dumps(copied_config), - }) - @pytest.mark.skipif( platform.system() == "Windows", reason="Failing on Windows.")