From 9f74827b345a1360af6959694b896c5edd0fed15 Mon Sep 17 00:00:00 2001 From: XuanYang-cn Date: Mon, 17 Jun 2024 19:25:53 +0800 Subject: [PATCH] fix: drop_index got multiple values for keyword argument (#2138) Signed-off-by: yangxuan --- pymilvus/orm/collection.py | 9 ++++----- pymilvus/orm/index.py | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pymilvus/orm/collection.py b/pymilvus/orm/collection.py index c26cea2c9..e7afbc19c 100644 --- a/pymilvus/orm/collection.py +++ b/pymilvus/orm/collection.py @@ -1476,14 +1476,13 @@ def drop_index(self, timeout: Optional[float] = None, **kwargs): conn = self._get_connection() tmp_index = conn.describe_index(self._name, index_name, timeout=timeout, **copy_kwargs) if tmp_index is not None: - index = Index( - collection=self, + conn.drop_index( + collection_name=self._name, field_name=tmp_index["field_name"], - index_params=tmp_index, - construct_only=True, index_name=index_name, + timeout=timeout, + **copy_kwargs, ) - index.drop(timeout=timeout, **kwargs) def compact(self, timeout: Optional[float] = None, **kwargs): """Compact merge the small segments in a collection diff --git a/pymilvus/orm/index.py b/pymilvus/orm/index.py index 60df45d56..db82abd9a 100644 --- a/pymilvus/orm/index.py +++ b/pymilvus/orm/index.py @@ -130,16 +130,12 @@ def drop(self, timeout: Optional[float] = None, **kwargs): timeout(float, optional): An optional duration of time in seconds to allow for the RPC. When timeout is set to None, client waits until server response or error occur - kwargs: - * *index_name* (``str``) -- - The name of index. If no index is specified, the default index name is used. """ - copy_kwargs = copy.deepcopy(kwargs) conn = self._get_connection() conn.drop_index( collection_name=self._collection.name, field_name=self.field_name, index_name=self.index_name, timeout=timeout, - **copy_kwargs, + **kwargs, )