Added info logs when graph is truncated
This commit is contained in:
@@ -287,6 +287,9 @@ class NetworkXStorage(BaseGraphStorage):
|
|||||||
# Check if graph is truncated
|
# Check if graph is truncated
|
||||||
if len(sorted_nodes) > max_nodes:
|
if len(sorted_nodes) > max_nodes:
|
||||||
result.is_truncated = True
|
result.is_truncated = True
|
||||||
|
logger.info(
|
||||||
|
f"Graph truncated: {len(sorted_nodes)} nodes found, limited to {max_nodes}"
|
||||||
|
)
|
||||||
|
|
||||||
limited_nodes = [node for node, _ in sorted_nodes[:max_nodes]]
|
limited_nodes = [node for node, _ in sorted_nodes[:max_nodes]]
|
||||||
# Create subgraph with the highest degree nodes
|
# Create subgraph with the highest degree nodes
|
||||||
@@ -317,6 +320,9 @@ class NetworkXStorage(BaseGraphStorage):
|
|||||||
# and we've reached max_nodes, then the graph is truncated
|
# and we've reached max_nodes, then the graph is truncated
|
||||||
if queue and len(bfs_nodes) >= max_nodes:
|
if queue and len(bfs_nodes) >= max_nodes:
|
||||||
result.is_truncated = True
|
result.is_truncated = True
|
||||||
|
logger.info(
|
||||||
|
f"Graph truncated: breadth-first search limited to {max_nodes} nodes"
|
||||||
|
)
|
||||||
|
|
||||||
# Create subgraph with BFS discovered nodes
|
# Create subgraph with BFS discovered nodes
|
||||||
subgraph = graph.subgraph(bfs_nodes)
|
subgraph = graph.subgraph(bfs_nodes)
|
||||||
|
Reference in New Issue
Block a user