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: Add is_clustering params for get_compaction_plans in orm #2428

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
11 changes: 10 additions & 1 deletion pymilvus/orm/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1563,17 +1563,26 @@ def wait_for_compaction_completed(
)
return conn.wait_for_compaction_completed(self.compaction_id, timeout=timeout, **kwargs)

def get_compaction_plans(self, timeout: Optional[float] = None, **kwargs) -> CompactionPlans:
def get_compaction_plans(
self, timeout: Optional[float] = None, is_clustering: Optional[bool] = False, **kwargs
) -> CompactionPlans:
"""Get the current compaction plans

Args:
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.

is_clustering (``bool``, optional): Option to get clustering compaction plan.

Returns:
CompactionPlans: All the plans' states of this compaction.
"""
conn = self._get_connection()
if is_clustering:
return conn.get_compaction_plans(
self.clustering_compaction_id, timeout=timeout, **kwargs
)
return conn.get_compaction_plans(self.compaction_id, timeout=timeout, **kwargs)

def get_replicas(self, timeout: Optional[float] = None, **kwargs) -> Replica:
Expand Down
Loading