From 0ca7c0e230af807f9b8c7415c249b3cd86c9b289 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 5 Mar 2025 15:07:11 +0800 Subject: [PATCH] Fix linting --- lightrag/kg/networkx_impl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lightrag/kg/networkx_impl.py b/lightrag/kg/networkx_impl.py index 4084993d..8a2789ca 100644 --- a/lightrag/kg/networkx_impl.py +++ b/lightrag/kg/networkx_impl.py @@ -270,7 +270,9 @@ class NetworkXStorage(BaseGraphStorage): # Handle special case for "*" label if node_label == "*": # For "*", return the entire graph including all nodes and edges - subgraph = graph.copy() # Create a copy to avoid modifying the original graph + subgraph = ( + graph.copy() + ) # Create a copy to avoid modifying the original graph else: # Find nodes with matching node id based on search_mode nodes_to_explore = [] @@ -312,7 +314,8 @@ class NetworkXStorage(BaseGraphStorage): nodes_to_keep = [ node for node, degree in subgraph.degree() - if node in start_nodes or node in direct_connected_nodes + if node in start_nodes + or node in direct_connected_nodes or degree >= min_degree ] subgraph = subgraph.subgraph(nodes_to_keep)