yangdx commited on
Commit
7b784d0
·
1 Parent(s): c4124e7

Fix linting

Browse files
Files changed (1) hide show
  1. lightrag/kg/networkx_impl.py +5 -2
lightrag/kg/networkx_impl.py CHANGED
@@ -270,7 +270,9 @@ class NetworkXStorage(BaseGraphStorage):
270
  # Handle special case for "*" label
271
  if node_label == "*":
272
  # For "*", return the entire graph including all nodes and edges
273
- subgraph = graph.copy() # Create a copy to avoid modifying the original graph
 
 
274
  else:
275
  # Find nodes with matching node id based on search_mode
276
  nodes_to_explore = []
@@ -312,7 +314,8 @@ class NetworkXStorage(BaseGraphStorage):
312
  nodes_to_keep = [
313
  node
314
  for node, degree in subgraph.degree()
315
- if node in start_nodes or node in direct_connected_nodes
 
316
  or degree >= min_degree
317
  ]
318
  subgraph = subgraph.subgraph(nodes_to_keep)
 
270
  # Handle special case for "*" label
271
  if node_label == "*":
272
  # For "*", return the entire graph including all nodes and edges
273
+ subgraph = (
274
+ graph.copy()
275
+ ) # Create a copy to avoid modifying the original graph
276
  else:
277
  # Find nodes with matching node id based on search_mode
278
  nodes_to_explore = []
 
314
  nodes_to_keep = [
315
  node
316
  for node, degree in subgraph.degree()
317
+ if node in start_nodes
318
+ or node in direct_connected_nodes
319
  or degree >= min_degree
320
  ]
321
  subgraph = subgraph.subgraph(nodes_to_keep)