From ddcb2b5349abfe609d6993cc92d9be2182717256 Mon Sep 17 00:00:00 2001 From: binbin <83755740+binbinlv@users.noreply.github.com> Date: Thu, 16 Sep 2021 17:21:49 +0800 Subject: [PATCH] Modify error message and update pymilvus (#8071) Signed-off-by: Binbin Lv --- tests/python_client/common/code_mapping.py | 2 +- tests/python_client/requirements.txt | 2 +- tests/python_client/testcases/test_index.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/python_client/common/code_mapping.py b/tests/python_client/common/code_mapping.py index d9825c4be8..4eaa17ea57 100644 --- a/tests/python_client/common/code_mapping.py +++ b/tests/python_client/common/code_mapping.py @@ -31,4 +31,4 @@ class PartitionErrorMessage(ExceptionsMessage): class IndexErrorMessage(ExceptionsMessage): - WrongFieldName = "%s has type %s, but expected one of: bytes, unicode" + WrongFieldName = "cannot create index on non-vector field: %s" diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index d32f33bda1..a4f1d5cd81 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -12,7 +12,7 @@ pytest-print==0.2.1 pytest-level==0.1.1 pytest-xdist==2.2.1 # pytest-parallel -pymilvus==2.0.0rc7.dev2 +pymilvus==2.0.0rc7.dev4 pytest-rerunfailures==9.1.1 git+https://github.com/Projectplace/pytest-tags ndg-httpsclient diff --git a/tests/python_client/testcases/test_index.py b/tests/python_client/testcases/test_index.py index e0e9660c95..42b19696b4 100644 --- a/tests/python_client/testcases/test_index.py +++ b/tests/python_client/testcases/test_index.py @@ -53,12 +53,11 @@ class TestIndexParams(TestcaseBase): collection_w = self.init_collection_wrap(name=collection_name) - log.error(iem.WrongFieldName % (str(field_name), type(field_name))) + log.error(iem.WrongFieldName % str(field_name)) self.index_wrap.init_index(collection_w.collection, field_name, default_index_params, check_task=CheckTasks.err_res, check_items={ct.err_code: 1, - ct.err_msg: iem.WrongFieldName % (str(field_name), - type(field_name).__name__)}) + ct.err_msg: iem.WrongFieldName % str(field_name)}) @pytest.mark.tags(CaseLabel.L1) def test_index_field_name_not_existed(self): @@ -71,7 +70,8 @@ class TestIndexParams(TestcaseBase): f_name = cf.gen_unique_str(prefix) collection_w = self.init_collection_wrap(name=c_name) self.index_wrap.init_index(collection_w.collection, f_name, default_index_params, check_task=CheckTasks.err_res, - check_items={ct.err_code: 1, ct.err_msg: "CreateIndex failed"}) + check_items={ct.err_code: 1, + ct.err_msg: f"cannot create index on non-existed field: {f_name}"}) @pytest.mark.tags(CaseLabel.L1) # TODO (reason="pymilvus issue #677", raises=TypeError)