From 54e4a31aa63028dc46df4ccf9fe2ff19f4c9c285 Mon Sep 17 00:00:00 2001 From: jofoks Date: Mon, 17 Mar 2025 17:32:54 -0700 Subject: [PATCH] Fixed get_by_id type error in PSQL impl --- lightrag/kg/postgres_impl.py | 3 +-- lightrag/lightrag.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index d2630659..36b98013 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -732,7 +732,7 @@ class PGDocStatusStorage(DocStatusStorage): if result is None or result == []: return None else: - return DocProcessingStatus( + return dict( content=result[0]["content"], content_length=result[0]["content_length"], content_summary=result[0]["content_summary"], @@ -1058,7 +1058,6 @@ class PGGraphStorage(BaseGraphStorage): Args: query (str): a cypher query to be executed - params (dict): parameters for the query Returns: list[dict[str, Any]]: a list of dictionaries containing the result set diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 27a03e12..3d891f87 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1473,8 +1473,7 @@ class LightRAG: """ try: # 1. Get the document status and related data - doc_status = await self.doc_status.get_by_id(doc_id) - if not doc_status: + if not await self.doc_status.get_by_id(doc_id): logger.warning(f"Document {doc_id} not found") return