From 0575f7764006474730f877af8bfe83a0b1b4861a Mon Sep 17 00:00:00 2001 From: venti <1308199824@qq.com> Date: Sat, 30 May 2026 16:42:57 +0800 Subject: [PATCH 1/2] fix: preserve entities without community assignment in community level filter (fixes #2348) --- packages/graphrag/graphrag/query/indexer_adapters.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/graphrag/graphrag/query/indexer_adapters.py b/packages/graphrag/graphrag/query/indexer_adapters.py index 7119ad842c..4db0de2e78 100644 --- a/packages/graphrag/graphrag/query/indexer_adapters.py +++ b/packages/graphrag/graphrag/query/indexer_adapters.py @@ -219,7 +219,16 @@ def embed_community_reports( def _filter_under_community_level( df: pd.DataFrame, community_level: int ) -> pd.DataFrame: + nan_count = df.level.isna().sum() + if nan_count > 0: + orphan_pct = nan_count / len(df) * 100 + if orphan_pct > 10: + logger.warning( + "%.0f%% of entities have no community assignment. " + "Consider checking your community detection settings.", + orphan_pct, + ) return cast( "pd.DataFrame", - df[df.level <= community_level], + df[(df.level <= community_level) | df.level.isna()], ) From c32cca2018148567dea6830fa264a91dffae29f8 Mon Sep 17 00:00:00 2001 From: venti <1308199824@qq.com> Date: Sat, 30 May 2026 16:56:52 +0800 Subject: [PATCH 2/2] fix: call strip() with parentheses to properly check whitespace-only vector store URIs (fixes #2381) --- packages/graphrag/graphrag/config/models/graph_rag_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphrag/graphrag/config/models/graph_rag_config.py b/packages/graphrag/graphrag/config/models/graph_rag_config.py index 1b753d58fc..eb32b3e5a7 100644 --- a/packages/graphrag/graphrag/config/models/graph_rag_config.py +++ b/packages/graphrag/graphrag/config/models/graph_rag_config.py @@ -270,7 +270,7 @@ def _validate_vector_store_db_uri(self) -> None: """Validate the vector store configuration.""" store = self.vector_store if store.type == VectorStoreType.LanceDB: - if not store.db_uri or store.db_uri.strip == "": + if not store.db_uri or store.db_uri.strip() == "": store.db_uri = graphrag_config_defaults.vector_store.db_uri store.db_uri = str(Path(store.db_uri).resolve())