Skip to content

Commit

Permalink
fix empty children in mindmap (infiniflow#2418)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Sep 13, 2024
1 parent 6824bbe commit a742afe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graphrag/mind_map_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _be_children(self, obj: dict, keyset: set):
obj = [obj]
if isinstance(obj, list):
for i in obj: keyset.add(i)
return [{"id": re.sub(r"\*+", "", i), "children": []} for i in obj]
return [{"id": re.sub(r"\*+", "", i), "children": []} for i in obj if re.sub(r"\*+", "", i)]
arr = []
for k, v in obj.items():
k = self._key(k)
Expand Down

0 comments on commit a742afe

Please sign in to comment.