remove drops unused

This commit is contained in:
Yannick Stephan
2025-02-17 23:16:17 +01:00
parent 442838d0f1
commit 66c4b01fdd
7 changed files with 2 additions and 37 deletions

View File

@@ -68,6 +68,3 @@ class JsonDocStatusStorage(DocStatusStorage):
for doc_id in doc_ids: for doc_id in doc_ids:
self._data.pop(doc_id, None) self._data.pop(doc_id, None)
await self.index_done_callback() 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} left_data = {k: v for k, v in data.items() if k not in self._data}
self._data.update(left_data) self._data.update(left_data)
async def drop(self) -> None:
self._data = {}
async def delete(self, ids: list[str]) -> None: async def delete(self, ids: list[str]) -> None:
for doc_id in ids: for doc_id in ids:
self._data.pop(doc_id, None) self._data.pop(doc_id, None)

View File

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

View File

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

View File

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

View File

@@ -58,11 +58,6 @@ class RedisKVStorage(BaseKVStorage):
for k in data: for k in data:
data[k]["_id"] = k 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: async def index_done_callback(self) -> None:
# Redis handles persistence automatically # Redis handles persistence automatically
pass pass

View File

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