Skip to content

Commit cddbf61

Browse files
authored
fix: drop_index got multiple values for keyword argument (#2139)
Signed-off-by: yangxuan <[email protected]>
1 parent d0047c7 commit cddbf61

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pymilvus/orm/collection.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,14 +1476,13 @@ def drop_index(self, timeout: Optional[float] = None, **kwargs):
14761476
conn = self._get_connection()
14771477
tmp_index = conn.describe_index(self._name, index_name, timeout=timeout, **copy_kwargs)
14781478
if tmp_index is not None:
1479-
index = Index(
1480-
collection=self,
1479+
conn.drop_index(
1480+
collection_name=self._name,
14811481
field_name=tmp_index["field_name"],
1482-
index_params=tmp_index,
1483-
construct_only=True,
14841482
index_name=index_name,
1483+
timeout=timeout,
1484+
**copy_kwargs,
14851485
)
1486-
index.drop(timeout=timeout, **kwargs)
14871486

14881487
def compact(self, timeout: Optional[float] = None, is_major: Optional[bool] = False, **kwargs):
14891488
"""Compact merge the small segments in a collection

pymilvus/orm/index.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,12 @@ def drop(self, timeout: Optional[float] = None, **kwargs):
130130
timeout(float, optional): An optional duration of time in seconds to allow
131131
for the RPC. When timeout is set to None, client waits until server response
132132
or error occur
133-
kwargs:
134-
* *index_name* (``str``) --
135-
The name of index. If no index is specified, the default index name is used.
136133
"""
137-
copy_kwargs = copy.deepcopy(kwargs)
138134
conn = self._get_connection()
139135
conn.drop_index(
140136
collection_name=self._collection.name,
141137
field_name=self.field_name,
142138
index_name=self.index_name,
143139
timeout=timeout,
144-
**copy_kwargs,
140+
**kwargs,
145141
)

0 commit comments

Comments
 (0)