Check field dim when inserting

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/4973/head^2
cai.zhang 2021-03-08 16:00:52 +08:00 committed by yefu.chen
parent 55fc3f56aa
commit ac186cc0e5
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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