mirror of https://github.com/milvus-io/milvus.git
Add test cases about supporting bool as output fields for query and search (#18649)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com> Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>pull/18668/head
parent
d878cc2ec0
commit
bf5fb425f6
|
@ -9,7 +9,7 @@ allure-pytest==2.7.0
|
|||
pytest-print==0.2.1
|
||||
pytest-level==0.1.1
|
||||
pytest-xdist==2.5.0
|
||||
pymilvus==2.2.0.dev6
|
||||
pymilvus==2.2.0.dev8
|
||||
pytest-rerunfailures==9.1.1
|
||||
git+https://github.com/Projectplace/pytest-tags
|
||||
ndg-httpsclient
|
||||
|
|
|
@ -539,17 +539,19 @@ class TestQueryParams(TestcaseBase):
|
|||
assert set(res[0].keys()) == {ct.default_int64_field_name, ct.default_float_field_name}
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
@pytest.mark.xfail(reason="issue 18624")
|
||||
def test_query_output_all_fields(self):
|
||||
"""
|
||||
target: test query with none output field
|
||||
method: query with output field=None
|
||||
expected: return all fields
|
||||
"""
|
||||
collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix))
|
||||
df = cf.gen_default_dataframe_data()
|
||||
collection_w.insert(df)
|
||||
assert collection_w.num_entities == ct.default_nb
|
||||
all_fields = [ct.default_int64_field_name, ct.default_float_field_name, ct.default_string_field_name, ct.default_float_vec_field_name]
|
||||
# 1. initialize with data
|
||||
collection_w, df, _, insert_ids = self.init_collection_general(prefix, True, nb=10,
|
||||
is_all_data_type=True)[0:4]
|
||||
all_fields = [ct.default_int64_field_name, ct.default_int32_field_name, ct.default_int16_field_name,
|
||||
ct.default_int8_field_name, ct.default_bool_field_name, ct.default_float_field_name,
|
||||
ct.default_double_field_name, ct.default_string_field_name, ct.default_float_vec_field_name]
|
||||
res = df.iloc[:2].to_dict('records')
|
||||
collection_w.load()
|
||||
actual_res, _ = collection_w.query(default_term_expr, output_fields=all_fields,
|
||||
|
|
|
@ -2020,7 +2020,8 @@ class TestCollectionSearch(TestcaseBase):
|
|||
default_search_params, default_limit,
|
||||
search_exp, _async=_async,
|
||||
output_fields=[default_int64_field_name,
|
||||
default_float_field_name],
|
||||
default_float_field_name,
|
||||
default_bool_field_name],
|
||||
check_task=CheckTasks.check_search_results,
|
||||
check_items={"nq": nq,
|
||||
"ids": insert_ids,
|
||||
|
@ -2030,7 +2031,8 @@ class TestCollectionSearch(TestcaseBase):
|
|||
res.done()
|
||||
res = res.result()
|
||||
assert len(res[0][0].entity._row_data) != 0
|
||||
assert (default_int64_field_name and default_float_field_name) in res[0][0].entity._row_data
|
||||
assert (default_int64_field_name and default_float_field_name and default_bool_field_name) \
|
||||
in res[0][0].entity._row_data
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_search_with_output_fields_empty(self, nb, nq, dim, auto_id, _async):
|
||||
|
|
Loading…
Reference in New Issue