From 100a43b2142c3bc1407cc6034b5be2c74bf5921e Mon Sep 17 00:00:00 2001 From: remonxiao Date: Thu, 27 Nov 2025 10:36:40 +0800 Subject: [PATCH] Fix: Flatten results from update_community calls - Fixed ValueError when update_communities=True - semaphore_gather returns a list of tuples, not a single tuple - Added proper unpacking and flattening logic - Bug was introduced in commit dcc9da3 Resolves issue where update_communities parameter would fail with: 'ValueError: not enough values to unpack (expected 2, got 1)' --- graphiti_core/graphiti.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphiti_core/graphiti.py b/graphiti_core/graphiti.py index c4fa60c5..5b121ac8 100644 --- a/graphiti_core/graphiti.py +++ b/graphiti_core/graphiti.py @@ -778,13 +778,17 @@ class Graphiti: communities = [] community_edges = [] if update_communities: - communities, community_edges = await semaphore_gather( + results = await semaphore_gather( *[ update_community(self.driver, self.llm_client, self.embedder, node) for node in nodes ], max_coroutines=self.max_coroutines, ) + # Flatten results from multiple update_community calls + for community_list, edge_list in results: + communities.extend(community_list) + community_edges.extend(edge_list) end = time()