yangdx commited on
Commit
77e50f9
·
1 Parent(s): 035427d

Let get_edge return None when edge not found

Browse files
Files changed (1) hide show
  1. lightrag/kg/neo4j_impl.py +2 -7
lightrag/kg/neo4j_impl.py CHANGED
@@ -452,13 +452,8 @@ class Neo4JStorage(BaseGraphStorage):
452
  logger.debug(
453
  f"{inspect.currentframe().f_code.co_name}: No edge found between {source_node_id} and {target_node_id}"
454
  )
455
- # Return default edge properties when no edge found
456
- return {
457
- "weight": 0.0,
458
- "source_id": None,
459
- "description": None,
460
- "keywords": None,
461
- }
462
  finally:
463
  await result.consume() # Ensure result is fully consumed
464
 
 
452
  logger.debug(
453
  f"{inspect.currentframe().f_code.co_name}: No edge found between {source_node_id} and {target_node_id}"
454
  )
455
+ # Return None when no edge found
456
+ return None
 
 
 
 
 
457
  finally:
458
  await result.consume() # Ensure result is fully consumed
459