From ac186cc0e5eab170ce2bedd9576f447d5662c2f5 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Mon, 8 Mar 2021 16:00:52 +0800 Subject: [PATCH] Check field dim when inserting Signed-off-by: cai.zhang --- tests/python_test/entity/test_insert.py | 3 ++- tests/python_test/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/python_test/entity/test_insert.py b/tests/python_test/entity/test_insert.py index 84f988fbac..5ea16d28d6 100644 --- a/tests/python_test/entity/test_insert.py +++ b/tests/python_test/entity/test_insert.py @@ -370,6 +370,7 @@ class TestInsertBase: res = connect.get_collection_stats(collection) assert res[row_count] == 2 * default_nb + @pytest.mark.tags("0331") def test_insert_dim_not_matched(self, connect, collection): ''' target: test insert entities, the vector dimension is not equal to the collection dimension @@ -378,7 +379,7 @@ class TestInsertBase: ''' vectors = gen_vectors(default_nb, int(default_dim) // 2) insert_entities = copy.deepcopy(default_entities) - insert_entities[-1][default_float_vec_field_name] = vectors + insert_entities[-1]["values"] = vectors # logging.getLogger().info(len(insert_entities[-1][default_float_vec_field_name][0])) with pytest.raises(Exception) as e: connect.insert(collection, insert_entities) diff --git a/tests/python_test/requirements.txt b/tests/python_test/requirements.txt index 8114a4f569..5f4c1c8bed 100644 --- a/tests/python_test/requirements.txt +++ b/tests/python_test/requirements.txt @@ -2,7 +2,7 @@ grpcio==1.26.0 grpcio-tools==1.26.0 numpy==1.18.1 pytest-cov==2.8.1 -pymilvus-distributed==0.0.37 +pymilvus-distributed==0.0.39 sklearn==0.0 pytest==4.5.0 pytest-timeout==1.3.3