Fix linting
This commit is contained in:
@@ -20,6 +20,7 @@ from lightrag.base import DocProcessingStatus, DocStatus
|
||||
from lightrag.api.utils_api import get_combined_auth_dependency
|
||||
from ..config import global_args
|
||||
|
||||
|
||||
# Function to format datetime to ISO format string with timezone information
|
||||
def format_datetime(dt: Any) -> Optional[str]:
|
||||
"""Format datetime to ISO format string with timezone information
|
||||
@@ -44,6 +45,7 @@ def format_datetime(dt: Any) -> Optional[str]:
|
||||
# Return ISO format string with timezone information
|
||||
return dt.isoformat()
|
||||
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/documents",
|
||||
tags=["documents"],
|
||||
@@ -338,7 +340,7 @@ class PipelineStatusResponse(BaseModel):
|
||||
history_messages: Optional[List[str]] = None
|
||||
update_status: Optional[dict] = None
|
||||
|
||||
@field_validator('job_start', mode='before')
|
||||
@field_validator("job_start", mode="before")
|
||||
@classmethod
|
||||
def parse_job_start(cls, value):
|
||||
"""Process datetime and return as ISO format string with timezone"""
|
||||
@@ -1263,12 +1265,8 @@ def create_document_routes(
|
||||
content_summary=doc_status.content_summary,
|
||||
content_length=doc_status.content_length,
|
||||
status=doc_status.status,
|
||||
created_at=format_datetime(
|
||||
doc_status.created_at
|
||||
),
|
||||
updated_at=format_datetime(
|
||||
doc_status.updated_at
|
||||
),
|
||||
created_at=format_datetime(doc_status.created_at),
|
||||
updated_at=format_datetime(doc_status.updated_at),
|
||||
chunks_count=doc_status.chunks_count,
|
||||
error=doc_status.error,
|
||||
metadata=doc_status.metadata,
|
||||
|
@@ -958,7 +958,9 @@ class LightRAG:
|
||||
"content_summary": status_doc.content_summary,
|
||||
"content_length": status_doc.content_length,
|
||||
"created_at": status_doc.created_at,
|
||||
"updated_at": datetime.now(timezone.utc).isoformat(),
|
||||
"updated_at": datetime.now(
|
||||
timezone.utc
|
||||
).isoformat(),
|
||||
"file_path": file_path,
|
||||
}
|
||||
}
|
||||
@@ -1018,7 +1020,9 @@ class LightRAG:
|
||||
"content_summary": status_doc.content_summary,
|
||||
"content_length": status_doc.content_length,
|
||||
"created_at": status_doc.created_at,
|
||||
"updated_at": datetime.now(timezone.utc).isoformat(),
|
||||
"updated_at": datetime.now(
|
||||
timezone.utc
|
||||
).isoformat(),
|
||||
"file_path": file_path,
|
||||
}
|
||||
}
|
||||
@@ -1053,7 +1057,9 @@ class LightRAG:
|
||||
"content_summary": status_doc.content_summary,
|
||||
"content_length": status_doc.content_length,
|
||||
"created_at": status_doc.created_at,
|
||||
"updated_at": datetime.now(timezone.utc).isoformat(),
|
||||
"updated_at": datetime.now(
|
||||
timezone.utc
|
||||
).isoformat(),
|
||||
"file_path": file_path,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user