From fed46970d5271338575b7cccd21fa8027b0fea5e Mon Sep 17 00:00:00 2001 From: zjgemi Date: Mon, 1 Apr 2024 16:58:53 +0800 Subject: [PATCH] fix: add prefix when upload_s3 with key Signed-off-by: zjgemi --- src/dflow/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dflow/utils.py b/src/dflow/utils.py index 5e575721..db08d2b3 100644 --- a/src/dflow/utils.py +++ b/src/dflow/utils.py @@ -395,7 +395,9 @@ def upload_s3( else: client = MinioClient(**kwargs) if key is not None: - pass + if not key.startswith(s3_config["prefix"]) and not any( + [key.startswith(p) for p in s3_config["extra_prefixes"]]): + key = s3_config["prefix"] + key elif prefix is not None: if prefix[-1] != "/": prefix += "/"