From f27f2f3c1365a4437a7ea0c70fd99ed7c0979cb5 Mon Sep 17 00:00:00 2001 From: Cai Zhang Date: Wed, 11 Dec 2024 20:00:48 +0800 Subject: [PATCH] Add is_clustering params for get_compaction_plans in orm Signed-off-by: Cai Zhang --- pymilvus/orm/collection.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pymilvus/orm/collection.py b/pymilvus/orm/collection.py index ca823f5e9..4fdaff971 100644 --- a/pymilvus/orm/collection.py +++ b/pymilvus/orm/collection.py @@ -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: