未验证 提交 22d56849 编写于 作者: N nico 提交者: GitHub

Update output binary vector field cases (#25819)

Signed-off-by: Nnico <cheng.yuan@zilliz.com>
上级 8542b266
...@@ -12,7 +12,7 @@ allure-pytest==2.7.0 ...@@ -12,7 +12,7 @@ allure-pytest==2.7.0
pytest-print==0.2.1 pytest-print==0.2.1
pytest-level==0.1.1 pytest-level==0.1.1
pytest-xdist==2.5.0 pytest-xdist==2.5.0
pymilvus==2.2.14.dev15 pymilvus==2.2.14.dev16
pytest-rerunfailures==9.1.1 pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient ndg-httpsclient
......
...@@ -1207,7 +1207,7 @@ class TestCollectionDataframe(TestcaseBase): ...@@ -1207,7 +1207,7 @@ class TestCollectionDataframe(TestcaseBase):
""" """
self._connect() self._connect()
c_name = cf.gen_unique_str(prefix) c_name = cf.gen_unique_str(prefix)
error = {ct.err_code: 0, ct.err_msg: "Dataframe can not be None."} error = {ct.err_code: 1, ct.err_msg: "Dataframe can not be None."}
self.collection_wrap.construct_from_dataframe(c_name, None, check_task=CheckTasks.err_res, check_items=error) self.collection_wrap.construct_from_dataframe(c_name, None, check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
......
...@@ -1076,8 +1076,8 @@ class TestCollectionSearch(TestcaseBase): ...@@ -1076,8 +1076,8 @@ class TestCollectionSearch(TestcaseBase):
expected: search successfully expected: search successfully
""" """
# 1. initialize with data # 1. initialize with data
collection_w, _, _, insert_ids = \ collection_w = \
self.init_collection_general(prefix, is_index=False, primary_field=default_string_field_name)[0:4] self.init_collection_general(prefix, is_index=False, primary_field=default_string_field_name)[0]
nb = 500 nb = 500
data = cf.gen_default_list_data(nb) data = cf.gen_default_list_data(nb)
for _ in range(10): for _ in range(10):
...@@ -1094,7 +1094,6 @@ class TestCollectionSearch(TestcaseBase): ...@@ -1094,7 +1094,6 @@ class TestCollectionSearch(TestcaseBase):
search_params, default_limit, search_params, default_limit,
check_task=CheckTasks.check_search_results, check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq, check_items={"nq": default_nq,
"ids": insert_ids,
"limit": default_limit}) "limit": default_limit})
@pytest.mark.tags(CaseLabel.L0) @pytest.mark.tags(CaseLabel.L0)
...@@ -2792,8 +2791,7 @@ class TestCollectionSearch(TestcaseBase): ...@@ -2792,8 +2791,7 @@ class TestCollectionSearch(TestcaseBase):
"output_fields": [field_name]}) "output_fields": [field_name]})
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23661") @pytest.mark.parametrize("index", ["BIN_FLAT", "BIN_IVF_FLAT"])
@pytest.mark.parametrize("index", ct.all_index_types[6:8])
def test_search_output_field_vector_after_binary_index(self, index): def test_search_output_field_vector_after_binary_index(self, index):
""" """
target: test search with output vector field after binary index target: test search with output vector field after binary index
...@@ -2809,19 +2807,19 @@ class TestCollectionSearch(TestcaseBase): ...@@ -2809,19 +2807,19 @@ class TestCollectionSearch(TestcaseBase):
collection_w.insert(data) collection_w.insert(data)
# 2. create index and load # 2. create index and load
default_index = {"index_type": index, "params": {"nlist": 128}, "metric_type": "JACCARD"} default_index = {"index_type": index, "metric_type": "JACCARD", "params": {"nlist": 128}}
collection_w.create_index(binary_field_name, default_index) collection_w.create_index(binary_field_name, default_index)
collection_w.load() collection_w.load()
# 3. search with output field vector # 3. search with output field vector
search_params = {"metric_type": "JACCARD", "params": {"nprobe": 10}} search_params = {"metric_type": "JACCARD"}
binary_vectors = cf.gen_binary_vectors(1, default_dim)[1] binary_vectors = cf.gen_binary_vectors(1, default_dim)[1]
res = collection_w.search(binary_vectors, binary_field_name, res = collection_w.search(binary_vectors, binary_field_name,
ct.default_search_binary_params, 2, default_search_exp, search_params, 2, default_search_exp,
output_fields=[binary_field_name])[0] output_fields=[binary_field_name])[0]
# 4. check the result vectors should be equal to the inserted # 4. check the result vectors should be equal to the inserted
assert res[0][0].entity.binary_vector == data[binary_field_name][res[0][0].id] assert res[0][0].entity.binary_vector == [data[binary_field_name][res[0][0].id]]
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("dim", [32, 128, 768]) @pytest.mark.parametrize("dim", [32, 128, 768])
...@@ -2914,6 +2912,7 @@ class TestCollectionSearch(TestcaseBase): ...@@ -2914,6 +2912,7 @@ class TestCollectionSearch(TestcaseBase):
"output_fields": [field_name]}) "output_fields": [field_name]})
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip("not supported now")
@pytest.mark.parametrize("wildcard_output_fields", [["*"], ["*", default_int64_field_name]]) @pytest.mark.parametrize("wildcard_output_fields", [["*"], ["*", default_int64_field_name]])
def test_search_with_output_field_wildcard(self, wildcard_output_fields, auto_id, _async, enable_dynamic_field): def test_search_with_output_field_wildcard(self, wildcard_output_fields, auto_id, _async, enable_dynamic_field):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册