Fix linting

This commit is contained in:
yangdx
2025-03-05 15:07:11 +08:00
parent b08bf51b69
commit 0ca7c0e230

View File

@@ -270,7 +270,9 @@ class NetworkXStorage(BaseGraphStorage):
# Handle special case for "*" label # Handle special case for "*" label
if node_label == "*": if node_label == "*":
# For "*", return the entire graph including all nodes and edges # 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: else:
# Find nodes with matching node id based on search_mode # Find nodes with matching node id based on search_mode
nodes_to_explore = [] nodes_to_explore = []
@@ -312,7 +314,8 @@ class NetworkXStorage(BaseGraphStorage):
nodes_to_keep = [ nodes_to_keep = [
node node
for node, degree in subgraph.degree() 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 or degree >= min_degree
] ]
subgraph = subgraph.subgraph(nodes_to_keep) subgraph = subgraph.subgraph(nodes_to_keep)