Skip to content

Commit 0b55762

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: allow destination directory to exist before we copy.
PiperOrigin-RevId: 609578936
1 parent 2206d16 commit 0b55762

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

google/cloud/aiplatform/utils/prediction_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ def download_model_artifacts(artifact_uri: str) -> None:
150150
blob.download_to_filename(name_without_prefix)
151151
else:
152152
# Copy files to the current working directory.
153-
shutil.copytree(artifact_uri, ".")
153+
shutil.copytree(artifact_uri, ".", dirs_exist_ok=True)

tests/unit/aiplatform/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def test_download_model_artifacts_not_gcs_uri(
965965
prediction_utils.download_model_artifacts(model_dir_name)
966966

967967
assert not mock_storage_client.called
968-
copy_tree_mock.assert_called_once_with(model_dir_name, ".")
968+
copy_tree_mock.assert_called_once_with(model_dir_name, ".", dirs_exist_ok=True)
969969

970970

971971
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)