From 439201face826b206cc78ed3a93e455aa151936b Mon Sep 17 00:00:00 2001 From: widgit Date: Tue, 22 Apr 2025 19:49:31 +1000 Subject: [PATCH] Update postgres_impl.py fix get_all_labels error --- lightrag/kg/postgres_impl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index f313f063..31157a16 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -1807,7 +1807,10 @@ class PGGraphStorage(BaseGraphStorage): ) results = await self._query(query) - labels = [result["label"] for result in results] + labels = [] + for result in results: + if result and isinstance(result, dict) and "label" in result: + labels.append(result["label"]) return labels async def get_knowledge_graph(