Skip to content

Commit

Permalink
Fix keyerror issue while rebuilding graph. (#5022)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

#4995

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Feb 17, 2025
1 parent 194e8ea commit f29da49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graphrag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def rebuild_graph(tenant_id, kb_id):
src_ids.extend(d.get("source_id", []))
if d["knowledge_graph_kwd"] == "entity":
graph.add_node(d["entity_kwd"], entity_type=d["entity_type_kwd"])
else:
elif "from_entity_kwd" in d and "to_entity_kwd" in d:
graph.add_edge(
d["from_entity_kwd"],
d["to_entity_kwd"],
Expand Down

0 comments on commit f29da49

Please sign in to comment.