From 9bec79b2604ba1234a3f940b8e46ec1cb8d7f1f3 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Thu, 3 Jul 2025 16:59:37 +0800 Subject: [PATCH] fix: lint --- api/core/rag/extractor/helpers.py | 1 - api/core/rag/extractor/text_extractor.py | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/api/core/rag/extractor/helpers.py b/api/core/rag/extractor/helpers.py index fcaad74e39..3d2fb55d9a 100644 --- a/api/core/rag/extractor/helpers.py +++ b/api/core/rag/extractor/helpers.py @@ -1,7 +1,6 @@ """Document loader helpers.""" import concurrent.futures -import os from typing import NamedTuple, Optional, cast diff --git a/api/core/rag/extractor/text_extractor.py b/api/core/rag/extractor/text_extractor.py index a2dcf0a7bf..a00d328cb1 100644 --- a/api/core/rag/extractor/text_extractor.py +++ b/api/core/rag/extractor/text_extractor.py @@ -38,14 +38,10 @@ class TextExtractor(BaseExtractor): continue else: raise RuntimeError( - f"Decode failed: {self._file_path}, all detected encodings failed. " - f"Original error: {e}" + f"Decode failed: {self._file_path}, all detected encodings failed. Original error: {e}" ) else: - raise RuntimeError( - f"Decode failed: {self._file_path}, specified encoding failed. " - f"Original error: {e}" - ) + raise RuntimeError(f"Decode failed: {self._file_path}, specified encoding failed. Original error: {e}") except Exception as e: raise RuntimeError(f"Error loading {self._file_path}") from e