LightRAG/lightrag
BukeLy 4c12301e81 fix: correct parameter passing in delete_entity_relation
Why this change is needed:
The previous fix in commit 7dc1f83e incorrectly "fixed" delete_entity_relation
by converting the parameter dict to a list. However, PostgreSQLDB.execute()
expects a dict[str, Any] parameter, not a list. The execute() method internally
converts dict values to tuple (line 1487: tuple(data.values())), so passing
a list bypasses the expected interface and causes parameter binding issues.

What was wrong:
```python
params = {"workspace": self.workspace, "entity_name": entity_name}
await self.db.execute(delete_sql, list(params.values()))  # WRONG
```

The correct approach (matching delete_entity method):
```python
await self.db.execute(
    delete_sql, {"workspace": self.workspace, "entity_name": entity_name}
)
```

How it solves it:
- Pass parameters as a dict directly to db.execute(), matching the method signature
- Maintain consistency with delete_entity() which correctly passes a dict
- Let db.execute() handle the dict-to-tuple conversion internally as designed

Impact:
- delete_entity_relation now correctly passes parameters to PostgreSQL
- Method interface consistency with other delete operations
- Proper parameter binding ensures reliable entity relation deletion

Testing:
- All 6 PostgreSQL migration tests pass
- Verified parameter passing matches delete_entity pattern
- Code review identified the issue before production use

Related:
- Fixes incorrect "fix" from commit 7dc1f83e
- Aligns with PostgreSQLDB.execute() interface (line 1477-1480)
2025-11-19 23:31:09 +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 fix: correct parameter passing in delete_entity_relation 2025-11-19 23:31:09 +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 feat: enhance BaseVectorStorage for model isolation 2025-11-19 02:15:22 +08:00
constants.py Refactor entity merging with unified attribute merge function 2025-10-27 00:04:17 +08:00
exceptions.py Auto-initialize pipeline status in LightRAG.initialize_storages() 2025-11-17 12:54:33 +08:00
lightrag.py Fix linting 2025-11-18 22:38:43 +08:00
namespace.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
operate.py Adjust chunking parameters to match the default environment variable settings 2025-11-18 23:14:50 +08:00
prompt.py Fix typo in 'equipment' in prompt.py 2025-10-22 11:13:22 +08:00
rerank.py
types.py
utils.py feat: enhance EmbeddingFunc with model_name support 2025-11-19 02:11:39 +08:00
utils_graph.py Improve entity merge logging by removing redundant message and fixing typo 2025-10-31 17:16:59 +08:00