Skip to content

Commit

Permalink
fix: Removed dirs_exist_ok parameter as it's not backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmkc committed May 23, 2022
1 parent 095717c commit 89f7490
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion google/cloud/aiplatform/utils/source_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 89f7490

Please sign in to comment.