From 5b2f7296eabe6b9a21a9ef1ecdec7e61d9709581 Mon Sep 17 00:00:00 2001 From: brosoul Date: Mon, 9 Dec 2024 22:46:02 +0800 Subject: [PATCH] fix: download all the directory failed --- python/aibrix/aibrix/downloader/s3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/aibrix/aibrix/downloader/s3.py b/python/aibrix/aibrix/downloader/s3.py index c5fd3855..305efd64 100644 --- a/python/aibrix/aibrix/downloader/s3.py +++ b/python/aibrix/aibrix/downloader/s3.py @@ -123,7 +123,9 @@ def _directory_list(self, path: str) -> List[str]: Bucket=self.bucket_name, Delimiter="/", Prefix=path ) contents = objects_out.get("Contents", []) - return [content.get("Key") for content in contents] + files = [content.get("Key") for content in contents] + # filter the directory path + return [file for file in files if not file.endswith("/")] def _support_range_download(self) -> bool: return True