mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 12:52:39 +02:00
fix: resolve ruff F823 error by importing getLogger and ERROR directly
This commit is contained in:
parent
094bdfad45
commit
b3026e4412
1 changed files with 4 additions and 4 deletions
|
|
@ -4,6 +4,8 @@ File document processors for different ETL services (Unstructured, LlamaCloud, D
|
|||
|
||||
import contextlib
|
||||
import logging
|
||||
import warnings
|
||||
from logging import ERROR, getLogger
|
||||
|
||||
from fastapi import HTTPException
|
||||
from langchain_core.documents import Document as LangChainDocument
|
||||
|
|
@ -886,8 +888,6 @@ async def process_file_in_background(
|
|||
)
|
||||
|
||||
# Use Docling service for document processing
|
||||
import warnings
|
||||
|
||||
from app.services.docling_service import create_docling_service
|
||||
|
||||
# Create Docling service
|
||||
|
|
@ -896,7 +896,7 @@ async def process_file_in_background(
|
|||
# Suppress pdfminer warnings that can cause processing to hang
|
||||
# These warnings are harmless but can spam logs and potentially halt processing
|
||||
# Suppress both Python warnings and logging warnings from pdfminer
|
||||
pdfminer_logger = logging.getLogger("pdfminer")
|
||||
pdfminer_logger = getLogger("pdfminer")
|
||||
original_level = pdfminer_logger.level
|
||||
|
||||
with warnings.catch_warnings():
|
||||
|
|
@ -912,7 +912,7 @@ async def process_file_in_background(
|
|||
)
|
||||
|
||||
# Temporarily suppress pdfminer logging warnings
|
||||
pdfminer_logger.setLevel(logging.ERROR)
|
||||
pdfminer_logger.setLevel(ERROR)
|
||||
|
||||
try:
|
||||
# Process the document
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue