From 1a25a78e8a92a8601e04852464f0fe9504816af8 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 30 Mar 2025 10:25:49 +0800 Subject: [PATCH] feat: remove check_storage_env_vars and add TODOs - Remove unused check_storage_env_vars method - Add TODO to check if has_edge works on reverse relation - Add TODO about entities_vdb.client_storage local storage limitation --- lightrag/lightrag.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index dece78b4..0797ec2f 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1494,6 +1494,7 @@ class LightRAG: target_entity: Name of the target entity """ try: + # TODO: check if has_edge function works on reverse relation # Check if the relation exists edge_exists = await self.chunk_entity_relation_graph.has_edge( source_entity, target_entity @@ -1586,6 +1587,8 @@ class LightRAG: chunk_ids = set(related_chunks.keys()) logger.debug(f"Found {len(chunk_ids)} chunks to delete") + # TODO: self.entities_vdb.client_storage only works for local storage, need to fix this + # 3. Before deleting, check the related entities and relationships for these chunks for chunk_id in chunk_ids: # Check entities @@ -1857,24 +1860,6 @@ class LightRAG: return result - def check_storage_env_vars(self, storage_name: str) -> None: - """Check if all required environment variables for storage implementation exist - - Args: - storage_name: Storage implementation name - - Raises: - ValueError: If required environment variables are missing - """ - required_vars = STORAGE_ENV_REQUIREMENTS.get(storage_name, []) - missing_vars = [var for var in required_vars if var not in os.environ] - - if missing_vars: - raise ValueError( - f"Storage implementation '{storage_name}' requires the following " - f"environment variables: {', '.join(missing_vars)}" - ) - async def aclear_cache(self, modes: list[str] | None = None) -> None: """Clear cache data from the LLM response cache storage.