From b582fd6a7e94317a130a5858789194dda9bed657 Mon Sep 17 00:00:00 2001 From: Guodong Date: Mon, 30 Sep 2024 11:10:13 +0800 Subject: [PATCH 1/2] rm print & replace tmpfile create api --- .../llama_index/readers/minio/minio_client/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/minio_client/base.py b/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/minio_client/base.py index c49be47cd19d8..0f6b91b0318a5 100644 --- a/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/minio_client/base.py +++ b/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/minio_client/base.py @@ -98,7 +98,7 @@ def load_data(self) -> List[Document]: with tempfile.TemporaryDirectory() as temp_dir: if self.key: suffix = Path(self.key).suffix - filepath = f"{temp_dir}/{next(tempfile._get_candidate_names())}{suffix}" + _, filepath = tempfile.mkstemp(dir=temp_dir, suffix=suffix) minio_client.fget_object( bucket_name=self.bucket, object_name=self.key, file_path=filepath ) @@ -108,7 +108,6 @@ def load_data(self) -> List[Document]: ) for i, obj in enumerate(objects): file_name = obj.object_name.split("/")[-1] - print(file_name) if self.num_files_limit is not None and i > self.num_files_limit: break @@ -124,7 +123,6 @@ def load_data(self) -> List[Document]: continue filepath = f"{temp_dir}/{file_name}" - print(filepath) minio_client.fget_object(self.bucket, obj.object_name, filepath) loader = SimpleDirectoryReader( From 90e85683a71e8599f0ce23ef11ba31f7bf1f669b Mon Sep 17 00:00:00 2001 From: Guodong Date: Mon, 30 Sep 2024 11:10:58 +0800 Subject: [PATCH 2/2] bump version --- .../readers/llama-index-readers-minio/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama-index-integrations/readers/llama-index-readers-minio/pyproject.toml b/llama-index-integrations/readers/llama-index-readers-minio/pyproject.toml index e578c84a84338..13cb375fdfe94 100644 --- a/llama-index-integrations/readers/llama-index-readers-minio/pyproject.toml +++ b/llama-index-integrations/readers/llama-index-readers-minio/pyproject.toml @@ -28,7 +28,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-readers-minio" readme = "README.md" -version = "0.2.0" +version = "0.2.1" [tool.poetry.dependencies] python = ">=3.8.1,<4.0"