LightRAG/lightrag
BukeLy cf68cdfe3a refactor: improve PostgreSQL migration code quality
Why this change is needed:
1. Added clarifying comments to _pg_migrate_workspace_data() parameter handling
2. Removed dead code from PGDocStatusStorage.initialize() that was never executed

Changes:

1. PostgreSQL Migration Parameter Documentation (lightrag/kg/postgres_impl.py:2240-2241):
   - Added comments explaining dict rebuild for correct value ordering
   - Clarifies that Python 3.7+ dict insertion order is relied upon
   - Documents that execute() converts dict to tuple via .values()

2. Dead Code Removal (lightrag/kg/postgres_impl.py:3061-3062):
   - Removed unreachable table creation code from PGDocStatusStorage.initialize()
   - Table is already created by PostgreSQLDB.initdb() during initialization
   - This code path was never executed as table always exists before initialize() is called
   - Added NOTE comment explaining where table creation actually happens

Impact:
- No functional changes - only code clarification and cleanup
- Reduces maintenance burden by removing unreachable code
- Improves code readability with better documentation

Testing:
- All 14 PostgreSQL migration tests pass
- All 5 UnifiedLock safety tests pass
- Pre-commit checks pass (ruff-format, ruff)
2025-11-26 02:24:51 +08:00
..
api Bump API version to 0256 2025-11-18 23:15:31 +08:00
evaluation Update LLM cache migration docs and improve UX prompts 2025-11-08 23:48:19 +08:00
kg refactor: improve PostgreSQL migration code quality 2025-11-26 02:24:51 +08:00
llm Improve Bedrock error handling with retry logic and custom exceptions 2025-11-17 12:54:32 +08:00
tools Improve LightRAG initialization checker tool with better usage docs 2025-11-17 15:42:54 +08:00
__init__.py Bump core version to 1.4.9.9 and API to 0252 2025-11-08 11:27:26 +08:00
base.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
constants.py
exceptions.py Auto-initialize pipeline status in LightRAG.initialize_storages() 2025-11-17 12:54:33 +08:00
lightrag.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
namespace.py
operate.py Adjust chunking parameters to match the default environment variable settings 2025-11-18 23:14:50 +08:00
prompt.py
rerank.py
types.py
utils.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
utils_graph.py