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
This commit is contained in:
@@ -1494,6 +1494,7 @@ class LightRAG:
|
|||||||
target_entity: Name of the target entity
|
target_entity: Name of the target entity
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# TODO: check if has_edge function works on reverse relation
|
||||||
# Check if the relation exists
|
# Check if the relation exists
|
||||||
edge_exists = await self.chunk_entity_relation_graph.has_edge(
|
edge_exists = await self.chunk_entity_relation_graph.has_edge(
|
||||||
source_entity, target_entity
|
source_entity, target_entity
|
||||||
@@ -1586,6 +1587,8 @@ class LightRAG:
|
|||||||
chunk_ids = set(related_chunks.keys())
|
chunk_ids = set(related_chunks.keys())
|
||||||
logger.debug(f"Found {len(chunk_ids)} chunks to delete")
|
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
|
# 3. Before deleting, check the related entities and relationships for these chunks
|
||||||
for chunk_id in chunk_ids:
|
for chunk_id in chunk_ids:
|
||||||
# Check entities
|
# Check entities
|
||||||
@@ -1857,24 +1860,6 @@ class LightRAG:
|
|||||||
|
|
||||||
return result
|
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:
|
async def aclear_cache(self, modes: list[str] | None = None) -> None:
|
||||||
"""Clear cache data from the LLM response cache storage.
|
"""Clear cache data from the LLM response cache storage.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user