Skip to content

Commit

Permalink
fix: drop_index got multiple values for keyword argument (#2138)
Browse files Browse the repository at this point in the history
Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn authored Jun 17, 2024
1 parent 23847a6 commit 9f74827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 4 additions & 5 deletions pymilvus/orm/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions pymilvus/orm/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit 9f74827

Please sign in to comment.