Skip to content

Commit

Permalink
Do not create empty object for empty directory in S3 artifact reposit…
Browse files Browse the repository at this point in the history
…ory (mlflow#12415)

Signed-off-by: harupy <[email protected]>
Signed-off-by: Daniel Lok <[email protected]>
  • Loading branch information
harupy authored and daniellok-db committed Jun 20, 2024
1 parent d491995 commit b525ca3
Showing 1 changed file with 0 additions and 4 deletions.
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 + "/")

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

0 comments on commit b525ca3

Please sign in to comment.