From a71376ad6a24a328b2a62616666d5e5d7233cb66 Mon Sep 17 00:00:00 2001 From: Stephen Hu Date: Wed, 28 May 2025 11:46:41 +0800 Subject: [PATCH] Fix: KeyError: 'method' when build run_graphrag (#7899) ### What problem does this PR solve? Close #7879 I checked the current master code, the kb_parser_config is join from knowledge table, so I think should be some edge cases due to history data ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graphrag/general/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphrag/general/index.py b/graphrag/general/index.py index 4aa73ac40..db3645b35 100644 --- a/graphrag/general/index.py +++ b/graphrag/general/index.py @@ -57,7 +57,7 @@ async def run_graphrag( subgraph = await generate_subgraph( LightKGExt - if row["kb_parser_config"]["graphrag"]["method"] != "general" + if "method" not in row["kb_parser_config"]["graphrag"] or row["kb_parser_config"]["graphrag"]["method"] != "general" else GeneralKGExt, tenant_id, kb_id,