mirror of https://github.com/milvus-io/milvus.git
Check field dim when inserting
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>pull/4973/head^2
parent
55fc3f56aa
commit
ac186cc0e5
|
@ -370,6 +370,7 @@ class TestInsertBase:
|
||||||
res = connect.get_collection_stats(collection)
|
res = connect.get_collection_stats(collection)
|
||||||
assert res[row_count] == 2 * default_nb
|
assert res[row_count] == 2 * default_nb
|
||||||
|
|
||||||
|
@pytest.mark.tags("0331")
|
||||||
def test_insert_dim_not_matched(self, connect, collection):
|
def test_insert_dim_not_matched(self, connect, collection):
|
||||||
'''
|
'''
|
||||||
target: test insert entities, the vector dimension is not equal to the collection dimension
|
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)
|
vectors = gen_vectors(default_nb, int(default_dim) // 2)
|
||||||
insert_entities = copy.deepcopy(default_entities)
|
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]))
|
# logging.getLogger().info(len(insert_entities[-1][default_float_vec_field_name][0]))
|
||||||
with pytest.raises(Exception) as e:
|
with pytest.raises(Exception) as e:
|
||||||
connect.insert(collection, insert_entities)
|
connect.insert(collection, insert_entities)
|
||||||
|
|
|
@ -2,7 +2,7 @@ grpcio==1.26.0
|
||||||
grpcio-tools==1.26.0
|
grpcio-tools==1.26.0
|
||||||
numpy==1.18.1
|
numpy==1.18.1
|
||||||
pytest-cov==2.8.1
|
pytest-cov==2.8.1
|
||||||
pymilvus-distributed==0.0.37
|
pymilvus-distributed==0.0.39
|
||||||
sklearn==0.0
|
sklearn==0.0
|
||||||
pytest==4.5.0
|
pytest==4.5.0
|
||||||
pytest-timeout==1.3.3
|
pytest-timeout==1.3.3
|
||||||
|
|
Loading…
Reference in New Issue