fix: Check collection exists before drop it. (#17692)

Co-authored-by: wlleiiwang <wlleiiwang@tencent.com>
This commit is contained in:
wlleiiwang 2025-04-09 19:14:32 +08:00 committed by GitHub
parent abfcd9d3b6
commit f148f1efa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -279,7 +279,10 @@ class TencentVector(BaseVector):
return docs return docs
def delete(self) -> None: def delete(self) -> None:
self._client.drop_collection(database_name=self._client_config.database, collection_name=self.collection_name) if self._has_collection():
self._client.drop_collection(
database_name=self._client_config.database, collection_name=self.collection_name
)
class TencentVectorFactory(AbstractVectorFactory): class TencentVectorFactory(AbstractVectorFactory):