test: Fix a deep copy issue when getting search params (#32781)

related issue: #32653

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
This commit is contained in:
yanliang567 2024-05-06 17:11:29 +08:00 committed by GitHub
parent 0e3188b683
commit b9713f96fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View File

@ -1674,12 +1674,12 @@ def index_to_dict(index):
def get_index_params_params(index_type):
"""get default params of index params by index type"""
return ct.default_all_indexes_params[ct.all_index_types.index(index_type)]
return ct.default_all_indexes_params[ct.all_index_types.index(index_type)].copy()
def get_search_params_params(index_type):
"""get default params of search params by index type"""
return ct.default_all_search_params_params[ct.all_index_types.index(index_type)]
return ct.default_all_search_params_params[ct.all_index_types.index(index_type)].copy()
def assert_json_contains(expr, list_data):

View File

@ -271,11 +271,11 @@ default_bin_flat_index = {"index_type": "BIN_FLAT", "params": {}, "metric_type":
default_sparse_inverted_index = {"index_type": "SPARSE_INVERTED_INDEX", "metric_type": "IP",
"params": {"drop_ratio_build": 0.2}}
default_search_params = {"params": default_all_search_params_params[2]}
default_search_ip_params = {"metric_type": "IP", "params": default_all_search_params_params[2]}
default_search_params = {"params": default_all_search_params_params[2].copy()}
default_search_ip_params = {"metric_type": "IP", "params": default_all_search_params_params[2].copy()}
default_search_binary_params = {"metric_type": "JACCARD", "params": {"nprobe": 32}}
default_index = {"index_type": "IVF_SQ8", "metric_type": default_L0_metric, "params": default_all_indexes_params[2]}
default_binary_index = {"index_type": "BIN_IVF_FLAT", "metric_type": "JACCARD", "params": default_all_indexes_params[8]}
default_index = {"index_type": "IVF_SQ8", "metric_type": default_L0_metric, "params": default_all_indexes_params[2].copy()}
default_binary_index = {"index_type": "BIN_IVF_FLAT", "metric_type": "JACCARD", "params": default_all_indexes_params[8].copy()}
default_diskann_index = {"index_type": "DISKANN", "metric_type": default_L0_metric, "params": {}}
default_diskann_search_params = {"params": {"search_list": 30}}
default_sparse_search_params = {"metric_type": "IP", "params": {"drop_ratio_search": "0.2"}}

View File

@ -6891,7 +6891,7 @@ class TestCollectionRangeSearch(TestcaseBase):
@pytest.fixture(scope="function", params=ct.all_index_types[:7])
def index_type(self, request):
tags = request.config.getoption("--tags")
if CaseLabel.L2 not in tags:
if CaseLabel.L2 not in tags or "all" not in tags:
if request.param not in ct.L0_index_types:
pytest.skip(f"skip index type {request.param}")
yield request.param
@ -6899,7 +6899,7 @@ class TestCollectionRangeSearch(TestcaseBase):
@pytest.fixture(scope="function", params=ct.float_metrics)
def metric(self, request):
tags = request.config.getoption("--tags")
if CaseLabel.L2 not in tags:
if CaseLabel.L2 not in tags or "all" not in tags:
if request.param not in ct.default_L0_metric:
pytest.skip(f"skip index type {request.param}")
yield request.param
@ -10989,7 +10989,7 @@ class TestCollectionHybridSearchValid(TestcaseBase):
expected: hybrid search successfully with limit(topK)
"""
# 1. initialize collection with data
dim = 77
dim = 128
collection_w, _, _, insert_ids, time_stamp = \
self.init_collection_general(prefix, True, dim=dim, is_flush=is_flush, is_index=False,
primary_field=primary_field,
@ -11444,7 +11444,7 @@ class TestCollectionHybridSearchValid(TestcaseBase):
expected: hybrid search successfully with limit(topK)
"""
# 1. initialize collection with data
dim = 77
dim = 128
multiple_dim_array = [dim, dim]
collection_w, _, _, insert_ids, time_stamp = \
self.init_collection_general(prefix, True, dim=dim, is_index=False, primary_field=primary_field,