Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
6ed2675b
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6ed2675b
编写于
10月 06, 2021
作者:
B
binbin
提交者:
GitHub
10月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip ci] Fix triple double-quoted string (#9348)
Signed-off-by:
N
Binbin Lv
<
binbin.lv@zilliz.com
>
上级
9ad359f9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
30 deletion
+30
-30
tests/python_client/testcases/entity/test_insert.py
tests/python_client/testcases/entity/test_insert.py
+30
-30
未找到文件。
tests/python_client/testcases/entity/test_insert.py
浏览文件 @
6ed2675b
...
@@ -738,11 +738,11 @@ class TestInsertAsync:
...
@@ -738,11 +738,11 @@ class TestInsertAsync:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_async_long
(
self
,
connect
,
collection
):
def
test_insert_async_long
(
self
,
connect
,
collection
):
'''
"""
target: test insert vectors with different length of vectors
target: test insert vectors with different length of vectors
method: set different vectors as insert method params
method: set different vectors as insert method params
expected: length of ids is equal to the length of vectors
expected: length of ids is equal to the length of vectors
'''
"""
nb
=
50000
nb
=
50000
future
=
connect
.
insert
(
collection
,
gen_entities
(
nb
),
_async
=
True
,
_callback
=
self
.
check_result
)
future
=
connect
.
insert
(
collection
,
gen_entities
(
nb
),
_async
=
True
,
_callback
=
self
.
check_result
)
result
=
future
.
result
()
result
=
future
.
result
()
...
@@ -754,11 +754,11 @@ class TestInsertAsync:
...
@@ -754,11 +754,11 @@ class TestInsertAsync:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_async_callback_timeout
(
self
,
connect
,
collection
):
def
test_insert_async_callback_timeout
(
self
,
connect
,
collection
):
'''
"""
target: test insert vectors with different length of vectors
target: test insert vectors with different length of vectors
method: set different vectors as insert method params
method: set different vectors as insert method params
expected: length of ids is equal to the length of vectors
expected: length of ids is equal to the length of vectors
'''
"""
nb
=
100000
nb
=
100000
future
=
connect
.
insert
(
collection
,
gen_entities
(
nb
),
_async
=
True
,
_callback
=
self
.
check_status
,
timeout
=
1
)
future
=
connect
.
insert
(
collection
,
gen_entities
(
nb
),
_async
=
True
,
_callback
=
self
.
check_status
,
timeout
=
1
)
with
pytest
.
raises
(
Exception
)
as
e
:
with
pytest
.
raises
(
Exception
)
as
e
:
...
@@ -766,11 +766,11 @@ class TestInsertAsync:
...
@@ -766,11 +766,11 @@ class TestInsertAsync:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_insert_async_invalid_params
(
self
,
connect
):
def
test_insert_async_invalid_params
(
self
,
connect
):
'''
"""
target: test insert vectors with different length of vectors
target: test insert vectors with different length of vectors
method: set different vectors as insert method params
method: set different vectors as insert method params
expected: length of ids is equal to the length of vectors
expected: length of ids is equal to the length of vectors
'''
"""
collection_new
=
gen_unique_str
()
collection_new
=
gen_unique_str
()
future
=
connect
.
insert
(
collection_new
,
default_entities
,
_async
=
True
)
future
=
connect
.
insert
(
collection_new
,
default_entities
,
_async
=
True
)
future
.
done
()
future
.
done
()
...
@@ -780,11 +780,11 @@ class TestInsertAsync:
...
@@ -780,11 +780,11 @@ class TestInsertAsync:
# 1339
# 1339
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_async_invalid_params_raise_exception
(
self
,
connect
,
collection
):
def
test_insert_async_invalid_params_raise_exception
(
self
,
connect
,
collection
):
'''
"""
target: test insert vectors with different length of vectors
target: test insert vectors with different length of vectors
method: set different vectors as insert method params
method: set different vectors as insert method params
expected: length of ids is equal to the length of vectors
expected: length of ids is equal to the length of vectors
'''
"""
entities
=
[]
entities
=
[]
future
=
connect
.
insert
(
collection
,
entities
,
_async
=
True
)
future
=
connect
.
insert
(
collection
,
entities
,
_async
=
True
)
future
.
done
()
future
.
done
()
...
@@ -812,11 +812,11 @@ class TestInsertMultiCollections:
...
@@ -812,11 +812,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_entity_multi_collections
(
self
,
connect
):
def
test_insert_entity_multi_collections
(
self
,
connect
):
'''
"""
target: test insert entities
target: test insert entities
method: create 10 collections and insert entities into them in turn
method: create 10 collections and insert entities into them in turn
expected: row count
expected: row count
'''
"""
collection_num
=
10
collection_num
=
10
collection_list
=
[]
collection_list
=
[]
for
i
in
range
(
collection_num
):
for
i
in
range
(
collection_num
):
...
@@ -834,11 +834,11 @@ class TestInsertMultiCollections:
...
@@ -834,11 +834,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_collection_insert_entity_another
(
self
,
connect
,
collection
):
def
test_drop_collection_insert_entity_another
(
self
,
connect
,
collection
):
'''
"""
target: test insert vector to collection_1 after collection_2 deleted
target: test insert vector to collection_1 after collection_2 deleted
method: delete collection_2 and insert vector to collection_1
method: delete collection_2 and insert vector to collection_1
expected: row count equals the length of entities inserted
expected: row count equals the length of entities inserted
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
drop_collection
(
collection
)
connect
.
drop_collection
(
collection
)
...
@@ -849,11 +849,11 @@ class TestInsertMultiCollections:
...
@@ -849,11 +849,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_index_insert_entity_another
(
self
,
connect
,
collection
,
get_simple_index
):
def
test_create_index_insert_entity_another
(
self
,
connect
,
collection
,
get_simple_index
):
'''
"""
target: test insert vector to collection_2 after build index for collection_1
target: test insert vector to collection_2 after build index for collection_1
method: build index and insert vector
method: build index and insert vector
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_index
(
collection
,
field_name
,
get_simple_index
)
connect
.
create_index
(
collection
,
field_name
,
get_simple_index
)
...
@@ -868,11 +868,11 @@ class TestInsertMultiCollections:
...
@@ -868,11 +868,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_insert_entity_create_index_another
(
self
,
connect
,
collection
,
get_simple_index
):
def
test_insert_entity_create_index_another
(
self
,
connect
,
collection
,
get_simple_index
):
'''
"""
target: test insert vector to collection_2 after build index for collection_1
target: test insert vector to collection_2 after build index for collection_1
method: build index and insert vector
method: build index and insert vector
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
result
=
connect
.
insert
(
collection
,
default_entity
)
result
=
connect
.
insert
(
collection
,
default_entity
)
...
@@ -888,11 +888,11 @@ class TestInsertMultiCollections:
...
@@ -888,11 +888,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_entity_sleep_create_index_another
(
self
,
connect
,
collection
,
get_simple_index
):
def
test_insert_entity_sleep_create_index_another
(
self
,
connect
,
collection
,
get_simple_index
):
'''
"""
target: test insert vector to collection_2 after build index for collection_1 for a while
target: test insert vector to collection_2 after build index for collection_1 for a while
method: build index and insert vector
method: build index and insert vector
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
result
=
connect
.
insert
(
collection
,
default_entity
)
result
=
connect
.
insert
(
collection
,
default_entity
)
...
@@ -904,11 +904,11 @@ class TestInsertMultiCollections:
...
@@ -904,11 +904,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_search_entity_insert_entity_another
(
self
,
connect
,
collection
):
def
test_search_entity_insert_entity_another
(
self
,
connect
,
collection
):
'''
"""
target: test insert entity to collection_1 after search collection_2
target: test insert entity to collection_1 after search collection_2
method: search collection and insert entity
method: search collection and insert entity
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
load_collection
(
collection
)
connect
.
load_collection
(
collection
)
...
@@ -922,11 +922,11 @@ class TestInsertMultiCollections:
...
@@ -922,11 +922,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_insert_entity_search_entity_another
(
self
,
connect
,
collection
):
def
test_insert_entity_search_entity_another
(
self
,
connect
,
collection
):
'''
"""
target: test insert entity to collection_1 after search collection_2
target: test insert entity to collection_1 after search collection_2
method: search collection and insert entity
method: search collection and insert entity
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
result
=
connect
.
insert
(
collection
,
default_entity
)
result
=
connect
.
insert
(
collection
,
default_entity
)
...
@@ -939,11 +939,11 @@ class TestInsertMultiCollections:
...
@@ -939,11 +939,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_entity_sleep_search_entity_another
(
self
,
connect
,
collection
):
def
test_insert_entity_sleep_search_entity_another
(
self
,
connect
,
collection
):
'''
"""
target: test insert entity to collection_1 after search collection_2 a while
target: test insert entity to collection_1 after search collection_2 a while
method: search collection, sleep, and insert entity
method: search collection, sleep, and insert entity
expected: status ok
expected: status ok
'''
"""
collection_name
=
gen_unique_str
(
uid
)
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
connect
.
create_collection
(
collection_name
,
default_fields
)
result
=
connect
.
insert
(
collection
,
default_entity
)
result
=
connect
.
insert
(
collection
,
default_entity
)
...
@@ -955,11 +955,11 @@ class TestInsertMultiCollections:
...
@@ -955,11 +955,11 @@ class TestInsertMultiCollections:
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
ADD_TIMEOUT
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
_test_insert_entity_during_release_collection
(
self
,
connect
,
collection
):
def
_test_insert_entity_during_release_collection
(
self
,
connect
,
collection
):
'''
"""
target: test insert entity during release
target: test insert entity during release
method: release collection async, then do insert operation
method: release collection async, then do insert operation
expected: insert ok
expected: insert ok
'''
"""
for
i
in
range
(
10
):
for
i
in
range
(
10
):
connect
.
insert
(
collection
,
default_entities
)
connect
.
insert
(
collection
,
default_entities
)
connect
.
flush
([
collection
])
connect
.
flush
([
collection
])
...
@@ -1030,11 +1030,11 @@ class TestInsertInvalid(object):
...
@@ -1030,11 +1030,11 @@ class TestInsertInvalid(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_ids_invalid
(
self
,
connect
,
id_collection
,
get_entity_id
):
def
test_insert_ids_invalid
(
self
,
connect
,
id_collection
,
get_entity_id
):
'''
"""
target: test insert, with using customize ids, which are not int64
target: test insert, with using customize ids, which are not int64
method: create collection and insert entities in it
method: create collection and insert entities in it
expected: raise an exception
expected: raise an exception
'''
"""
entity_id
=
get_entity_id
entity_id
=
get_entity_id
ids
=
[
entity_id
for
_
in
range
(
default_nb
)]
ids
=
[
entity_id
for
_
in
range
(
default_nb
)]
with
pytest
.
raises
(
Exception
):
with
pytest
.
raises
(
Exception
):
...
@@ -1176,11 +1176,11 @@ class TestInsertInvalidBinary(object):
...
@@ -1176,11 +1176,11 @@ class TestInsertInvalidBinary(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_insert_ids_invalid
(
self
,
connect
,
binary_id_collection
,
get_entity_id
):
def
test_insert_ids_invalid
(
self
,
connect
,
binary_id_collection
,
get_entity_id
):
'''
"""
target: test insert, with using customize ids, which are not int64
target: test insert, with using customize ids, which are not int64
method: create collection and insert entities in it
method: create collection and insert entities in it
expected: raise an exception
expected: raise an exception
'''
"""
entity_id
=
get_entity_id
entity_id
=
get_entity_id
ids
=
[
entity_id
for
_
in
range
(
default_nb
)]
ids
=
[
entity_id
for
_
in
range
(
default_nb
)]
with
pytest
.
raises
(
Exception
):
with
pytest
.
raises
(
Exception
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录