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)
This commit is contained in:
Stephen Hu 2025-05-28 11:46:41 +08:00 committed by GitHub
parent 4d835b7303
commit a71376ad6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,7 +57,7 @@ async def run_graphrag(
subgraph = await generate_subgraph( subgraph = await generate_subgraph(
LightKGExt 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, else GeneralKGExt,
tenant_id, tenant_id,
kb_id, kb_id,