From 689cf44a5d038564e69778dc3134f4ae5f732b5c Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 4 Apr 2025 02:48:30 +0800 Subject: [PATCH] Let get_edge return None when edge not found --- lightrag/kg/neo4j_impl.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index b2c54d82..b84a0c6a 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -452,13 +452,8 @@ class Neo4JStorage(BaseGraphStorage): logger.debug( f"{inspect.currentframe().f_code.co_name}: No edge found between {source_node_id} and {target_node_id}" ) - # Return default edge properties when no edge found - return { - "weight": 0.0, - "source_id": None, - "description": None, - "keywords": None, - } + # Return None when no edge found + return None finally: await result.consume() # Ensure result is fully consumed