From 89f749070791932e286bb5948e7d04aa894b3aa6 Mon Sep 17 00:00:00 2001 From: ivanmkc Date: Tue, 19 Apr 2022 07:42:05 -0400 Subject: [PATCH] fix: Removed dirs_exist_ok parameter as it's not backwards compatible --- google/cloud/aiplatform/utils/source_utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/google/cloud/aiplatform/utils/source_utils.py b/google/cloud/aiplatform/utils/source_utils.py index 2a13daf452..0d82636115 100644 --- a/google/cloud/aiplatform/utils/source_utils.py +++ b/google/cloud/aiplatform/utils/source_utils.py @@ -171,7 +171,14 @@ def make_package(self, package_directory: str) -> str: fp.write(setup_py_output) if os.path.isdir(self.script_path): - shutil.copytree(self.script_path, trainer_path, dirs_exist_ok=True) + # Remove destination path if it already exists + shutil.rmtree(trainer_path) + + # Create destination path + os.makedirs(trainer_path) + + # Copy folder recursively + shutil.copytree(src=self.script_path, dst=trainer_path) else: # The module that will contain the script script_out_path = trainer_path / f"{self.task_module_name}.py"