graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

Fix ValueError when setting DataFrame columns in cluster_graph

Open eust-w opened this issue 1 year ago • 0 comments

Description

Fixed ValueError when setting DataFrame columns in cluster_graph by correcting the assignment of exploded DataFrame columns to ensure column length matches keys. This was done by replacing direct DataFrame assignment with explicit column assignment using the columns parameter, and adding detailed handling for splitting (level, graph) pairs into separate columns.

Related Issues

Resolves: #724

Proposed Changes

  • Corrected the assignment of exploded DataFrame columns to ensure column length matches keys.
  • Replaced direct DataFrame assignment with explicit column assignment using the columns parameter.
  • Added detailed handling for splitting (level, graph) pairs into separate columns.
  • Ensured the output DataFrame structure aligns correctly, preventing ValueError due to mismatched lengths.

Checklist

  • [x] I have tested these changes locally.
  • [x] I have reviewed the code changes.
  • [ ] I have updated the documentation (if necessary).
  • [ ] I have added appropriate unit tests (if applicable).

Additional Notes

N/A

eust-w avatar Jul 26 '24 05:07 eust-w