Skip to content

Commit

Permalink
fix: allow destination directory to exist before we copy.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 609578936
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Feb 23, 2024
1 parent 2206d16 commit 0b55762
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/utils/prediction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ def download_model_artifacts(artifact_uri: str) -> None:
blob.download_to_filename(name_without_prefix)
else:
# Copy files to the current working directory.
shutil.copytree(artifact_uri, ".")
shutil.copytree(artifact_uri, ".", dirs_exist_ok=True)
2 changes: 1 addition & 1 deletion tests/unit/aiplatform/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def test_download_model_artifacts_not_gcs_uri(
prediction_utils.download_model_artifacts(model_dir_name)

assert not mock_storage_client.called
copy_tree_mock.assert_called_once_with(model_dir_name, ".")
copy_tree_mock.assert_called_once_with(model_dir_name, ".", dirs_exist_ok=True)


@pytest.fixture(scope="function")
Expand Down

0 comments on commit 0b55762

Please sign in to comment.