Merge pull request #836 from YanSte/drop

fixed drop
This commit is contained in:
Yannick Stephan
2025-02-18 10:22:37 +01:00
committed by GitHub
4 changed files with 0 additions and 20 deletions

View File

@@ -135,10 +135,6 @@ class BaseKVStorage(StorageNameSpace, ABC):
async def upsert(self, data: dict[str, dict[str, Any]]) -> None:
"""Upsert data"""
@abstractmethod
async def drop(self) -> None:
"""Drop the storage"""
@dataclass
class BaseGraphStorage(StorageNameSpace, ABC):

View File

@@ -50,6 +50,3 @@ class JsonKVStorage(BaseKVStorage):
for doc_id in ids:
self._data.pop(doc_id, None)
await self.index_done_callback()
async def drop(self) -> None:
self._data = {}

View File

@@ -117,10 +117,6 @@ class MongoKVStorage(BaseKVStorage):
# Mongo handles persistence automatically
pass
async def drop(self) -> None:
"""Drop the collection"""
await self._data.drop()
@final
@dataclass
@@ -202,10 +198,6 @@ class MongoDocStatusStorage(DocStatusStorage):
# Mongo handles persistence automatically
pass
async def drop(self) -> None:
"""Drop the collection"""
await self._data.drop()
@final
@dataclass

View File

@@ -61,8 +61,3 @@ class RedisKVStorage(BaseKVStorage):
async def index_done_callback(self) -> None:
# Redis handles persistence automatically
pass
async def drop(self) -> None:
keys = await self._redis.keys(f"{self.namespace}:*")
if keys:
await self._redis.delete(*keys)