Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop_index got multiple values for keyword argument #2138

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)