From b525ca33baee8061e71501ea35bd06f1d98f97f5 Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Thu, 20 Jun 2024 10:04:41 +0900 Subject: [PATCH] Do not create empty object for empty directory in S3 artifact repository (#12415) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Signed-off-by: Daniel Lok --- mlflow/store/artifact/s3_artifact_repo.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mlflow/store/artifact/s3_artifact_repo.py b/mlflow/store/artifact/s3_artifact_repo.py index 7ed6ce5c86397..1764028b50021 100644 --- a/mlflow/store/artifact/s3_artifact_repo.py +++ b/mlflow/store/artifact/s3_artifact_repo.py @@ -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,