Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create empty object for empty directory in S3 artifact repository #12415

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mlflow/store/artifact/s3_artifact_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ def log_artifacts(self, local_dir, artifact_path=None):
rel_path = relative_path_to_artifact_path(rel_path)
upload_path = posixpath.join(dest_path, rel_path)

if not filenames:
# We're in an empty directory. Create a folder to preserve the directory structure.
s3_client.put_object(Bucket=bucket, Key=upload_path + "/")
Comment on lines -193 to -195
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember I made this change because nog logging empty folders break sentence_transformers tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_load_from_remote_uri was the failing test but it's passing now.


for f in filenames:
self._upload_file(
s3_client=s3_client,
Expand Down
Loading