From dc35ea2485eb366062e2d0ca5b839616f31295ab Mon Sep 17 00:00:00 2001 From: Patrick Weizhi Xu Date: Fri, 17 Jan 2025 10:24:56 +0800 Subject: [PATCH] fix: [2.5] should not modify users search_param, copy instead (#2578) issue: #2576 pr: https://github.com/milvus-io/pymilvus/pull/2577 Signed-off-by: Patrick Weizhi Xu (cherry picked from commit 5050421ebb43867410d64ee364fb2cb78437bb54) --- pymilvus/client/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymilvus/client/utils.py b/pymilvus/client/utils.py index c7c657377..d6af2b049 100644 --- a/pymilvus/client/utils.py +++ b/pymilvus/client/utils.py @@ -1,5 +1,6 @@ import datetime import importlib.util +from copy import deepcopy from datetime import timedelta from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union @@ -277,7 +278,7 @@ def get_params(search_params: Dict): # no more parameters will be written searchParams.params # to ensure compatibility and milvus can still get a json format parameter # try to write all the parameters under searchParams into searchParams.Params - params = search_params.get("params", {}) + params = deepcopy(search_params.get("params", {})) for key, value in search_params.items(): if key in params: if params[key] != value: