remove drops unused
This commit is contained in:
@@ -67,7 +67,4 @@ class JsonDocStatusStorage(DocStatusStorage):
|
|||||||
async def delete(self, doc_ids: list[str]):
|
async def delete(self, doc_ids: list[str]):
|
||||||
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
|
|
@@ -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)
|
||||||
|
@@ -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}}}]
|
||||||
|
@@ -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):
|
||||||
|
@@ -300,11 +300,7 @@ class PGKVStorage(BaseKVStorage):
|
|||||||
async def index_done_callback(self) -> None:
|
async def index_done_callback(self) -> None:
|
||||||
# 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."""
|
||||||
|
@@ -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
|
||||||
|
@@ -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):
|
||||||
|
Reference in New Issue
Block a user