From a44aceab1ea09bcb60e8f8bc048170d21a4713d3 Mon Sep 17 00:00:00 2001 From: Alex Potapenko Date: Sat, 14 Dec 2024 13:37:34 +0100 Subject: [PATCH] AGEStorage: fix has_node() and has_edge() --- lightrag/kg/age_impl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/kg/age_impl.py b/lightrag/kg/age_impl.py index 0c47b49b..5bd8198c 100644 --- a/lightrag/kg/age_impl.py +++ b/lightrag/kg/age_impl.py @@ -356,10 +356,10 @@ class AGEStorage(BaseGraphStorage): "{%s}:query:{%s}:result:{%s}", inspect.currentframe().f_code.co_name, query.format(**params), - single_result[0], + single_result["node_exists"], ) - return single_result["node_exists"].lower() == "true" + return single_result["node_exists"] async def has_edge(self, source_node_id: str, target_node_id: str) -> bool: entity_name_label_source = source_node_id.strip('"') @@ -378,9 +378,9 @@ class AGEStorage(BaseGraphStorage): "{%s}:query:{%s}:result:{%s}", inspect.currentframe().f_code.co_name, query.format(**params), - single_result[0], + single_result["edge_exists"], ) - return single_result["edge_exists"].lower() == "true" + return single_result["edge_exists"] async def get_node(self, node_id: str) -> Union[dict, None]: entity_name_label = node_id.strip('"')