diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index 83dfcf3b0..cc9e6afce 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -1010,8 +1010,18 @@ def load_partitions_progress(self, collection_name, partition_names, timeout=Non if status.error_code != 0: raise BaseException(status.error_code, status.reason) - pIDs = [response.partitionIDs[index] for index, p_name in enumerate(response.partition_names) - if p_name in partition_names] + pIDs = [] + pNames = [] + for index, p_name in enumerate(response.partition_names): + if p_name in partition_names: + pIDs.append(response.partitionIDs[index]) + pNames.append((p_name)) + + # all partition names must be valid, otherwise throw exception + for name in partition_names: + if not name in pNames: + msg = "partitionID of partitionName:" + name + " can not be found" + raise BaseException(1, msg) total_segments_nums = sum(info.num_rows for info in self.get_persistent_segment_infos(collection_name, timeout)