More robust community report. (#5328)

### What problem does this PR solve?

#5289
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-02-25 12:58:10 +08:00 committed by GitHub
parent 58a8f1f1b0
commit 1a41b92f77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ class CommunityReportsExtractor(Extractor):
weight = ents["weight"]
ents = ents["nodes"]
ent_df = pd.DataFrame(self._get_entity_(ents)).dropna()#[{"entity": n, **graph.nodes[n]} for n in ents])
if ent_df.empty:
if ent_df.empty or "entity_name" not in ent_df.columns:
continue
ent_df["entity"] = ent_df["entity_name"]
del ent_df["entity_name"]