Merge pull request #823 from YanSte/cleanup-drop

Cleanup drop
This commit is contained in:
Yannick Stephan
2025-02-17 23:30:57 +01:00
committed by GitHub
8 changed files with 4 additions and 44 deletions

View File

@@ -68,6 +68,3 @@ class JsonDocStatusStorage(DocStatusStorage):
for doc_id in doc_ids:
self._data.pop(doc_id, None)
await self.index_done_callback()
async def drop(self) -> None:
raise NotImplementedError

View File

@@ -46,9 +46,6 @@ class JsonKVStorage(BaseKVStorage):
left_data = {k: v for k, v in data.items() if k not in self._data}
self._data.update(left_data)
async def drop(self) -> None:
self._data = {}
async def delete(self, ids: list[str]) -> None:
for doc_id in ids:
self._data.pop(doc_id, None)

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
@@ -169,10 +165,6 @@ class MongoDocStatusStorage(DocStatusStorage):
)
await asyncio.gather(*update_tasks)
async def drop(self) -> None:
"""Drop the collection"""
await self._data.drop()
async def get_status_counts(self) -> dict[str, int]:
"""Get counts of documents in each status"""
pipeline = [{"$group": {"_id": "$status", "count": {"$sum": 1}}}]

View File

@@ -320,9 +320,6 @@ class OracleKVStorage(BaseKVStorage):
# Oracle handles persistence automatically
pass
async def drop(self) -> None:
raise NotImplementedError
@final
@dataclass

View File

@@ -301,9 +301,6 @@ class PGKVStorage(BaseKVStorage):
# PG handles persistence automatically
pass
async def drop(self) -> None:
raise NotImplementedError
@final
@dataclass
@@ -534,9 +531,6 @@ class PGDocStatusStorage(DocStatusStorage):
)
return data
async def drop(self) -> None:
raise NotImplementedError
class PGGraphQueryException(Exception):
"""Exception for the AGE queries."""

View File

@@ -58,11 +58,6 @@ class RedisKVStorage(BaseKVStorage):
for k in data:
data[k]["_id"] = k
async def drop(self) -> None:
keys = await self._redis.keys(f"{self.namespace}:*")
if keys:
await self._redis.delete(*keys)
async def index_done_callback(self) -> None:
# Redis handles persistence automatically
pass

View File

@@ -214,9 +214,6 @@ class TiDBKVStorage(BaseKVStorage):
# Ti handles persistence automatically
pass
async def drop(self) -> None:
raise NotImplementedError
@final
@dataclass