Skip to content

Conversation

@danielaskdd
Copy link
Collaborator

Refactor: Remove Deprecated Chunk-Based Query Methods and Improve Graph Unit Test

Overview

This PR removes deprecated chunk-based node/edge retrieval methods from all graph storage implementations and introduces workspace parameter support while improving test infrastructure and code quality.

Key Changes

🗑️ Deprecated Code Removal

  • Removed chunk-based query methods from all graph storage implementations:
    • get_nodes_by_chunk_ids() - removed from NetworkX, MongoDB, Neo4j, Memgraph, and PostgreSQL implementations
    • get_edges_by_chunk_ids() - removed from all graph storage backends
  • Total lines removed: ~380 lines of deprecated code across storage backends
    • lightrag/base.py: 51 lines
    • lightrag/kg/memgraph_impl.py: 74 lines
    • lightrag/kg/mongo_impl.py: 39 lines
    • lightrag/kg/neo4j_impl.py: 44 lines
    • lightrag/kg/networkx_impl.py: 28 lines
    • lightrag/kg/postgres_impl.py: 97 lines

✨ Graph Unit Test Improvements

  • Translated test file from Chinese to English for better international collaboration
  • Added workspace parameter support to storage initialization in tests
  • Removed deprecated test cases for chunk-based retrieval methods
  • Initialized shared storage for all graph storage types to ensure consistency

Breaking Changes

⚠️ Removed APIs (deprecated methods):

  • get_nodes_by_chunk_ids() - Applications should use alternative query methods
  • get_edges_by_chunk_ids() - Applications should use alternative query methods

@danielaskdd danielaskdd merged commit edf48d7 into HKUDS:main Nov 6, 2025
1 check passed
@danielaskdd danielaskdd deleted the remove-deprecated-code branch November 6, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant