Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
4d46aa53
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
4d46aa53
编写于
8月 10, 2022
作者:
B
binbin
提交者:
GitHub
8月 10, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update pymilvus version (#18575)
Signed-off-by:
N
Binbin Lv
<
binbin.lv@zilliz.com
>
上级
e7b3bacb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
46 addition
and
19 deletion
+46
-19
tests/python_client/base/collection_wrapper.py
tests/python_client/base/collection_wrapper.py
+26
-13
tests/python_client/base/partition_wrapper.py
tests/python_client/base/partition_wrapper.py
+13
-0
tests/python_client/requirements.txt
tests/python_client/requirements.txt
+1
-1
tests/python_client/testcases/test_alias.py
tests/python_client/testcases/test_alias.py
+2
-2
tests/python_client/testcases/test_collection.py
tests/python_client/testcases/test_collection.py
+1
-0
tests/python_client/testcases/test_e2e.py
tests/python_client/testcases/test_e2e.py
+2
-2
tests/python_client/testcases/test_index.py
tests/python_client/testcases/test_index.py
+1
-1
未找到文件。
tests/python_client/base/collection_wrapper.py
浏览文件 @
4d46aa53
...
...
@@ -53,10 +53,12 @@ class ApiCollectionWrapper:
@
property
def
is_empty
(
self
):
self
.
flush
()
return
self
.
collection
.
is_empty
@
property
def
num_entities
(
self
):
self
.
flush
()
return
self
.
collection
.
num_entities
@
property
...
...
@@ -120,22 +122,33 @@ class ApiCollectionWrapper:
**
kwargs
).
run
()
return
res
,
check_result
# @trace()
# def flush(self, check_task=None, check_items=None, **kwargs):
# #TODO:currently, flush is not supported by sdk in milvus
# timeout = kwargs.get("timeout", TIMEOUT)
#
# @timeout_decorator.timeout(timeout, timeout_exception=TimeoutError)
# def _flush():
# res = self.collection.num_entities
# return res
# try:
# res = _flush()
# return res, True
# except TimeoutError as e:
# log.error(f"flush timeout error: {e}")
# res = None
# return res, False
@
trace
()
def
flush
(
self
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
#TODO:currently, flush is not supported by sdk in milvus
timeout
=
kwargs
.
get
(
"timeout"
,
TIMEOUT
)
@
timeout_decorator
.
timeout
(
timeout
,
timeout_exception
=
TimeoutError
)
def
_flush
():
res
=
self
.
collection
.
num_entities
return
res
try
:
res
=
_flush
()
return
res
,
True
except
TimeoutError
as
e
:
log
.
error
(
f
"flush timeout error:
{
e
}
"
)
res
=
None
return
res
,
False
kwargs
.
update
({
"timeout"
:
timeout
})
func_name
=
sys
.
_getframe
().
f_code
.
co_name
res
,
check
=
api_request
([
self
.
collection
.
flush
],
**
kwargs
)
check_result
=
ResponseChecker
(
res
,
func_name
,
check_task
,
check_items
,
check
,
**
kwargs
).
run
()
return
res
,
check_result
@
trace
()
def
search
(
self
,
data
,
anns_field
,
param
,
limit
,
expr
=
None
,
...
...
tests/python_client/base/partition_wrapper.py
浏览文件 @
4d46aa53
...
...
@@ -35,10 +35,12 @@ class ApiPartitionWrapper:
@
property
def
is_empty
(
self
):
self
.
flush
()
return
self
.
partition
.
is_empty
if
self
.
partition
else
None
@
property
def
num_entities
(
self
):
self
.
flush
()
return
self
.
partition
.
num_entities
if
self
.
partition
else
None
def
drop
(
self
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
...
...
@@ -73,6 +75,17 @@ class ApiPartitionWrapper:
**
kwargs
).
run
()
return
res
,
check_result
def
flush
(
self
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
timeout
=
kwargs
.
get
(
"timeout"
,
TIMEOUT
)
kwargs
.
update
({
"timeout"
:
timeout
})
func_name
=
sys
.
_getframe
().
f_code
.
co_name
res
,
succ
=
api_request
([
self
.
partition
.
flush
],
**
kwargs
)
check_result
=
ResponseChecker
(
res
,
func_name
,
check_task
,
check_items
,
is_succ
=
succ
,
**
kwargs
).
run
()
return
res
,
check_result
def
insert
(
self
,
data
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
timeout
=
kwargs
.
get
(
"timeout"
,
TIMEOUT
)
kwargs
.
update
({
"timeout"
:
timeout
})
...
...
tests/python_client/requirements.txt
浏览文件 @
4d46aa53
...
...
@@ -9,7 +9,7 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pymilvus==2.
1.0.dev103
pymilvus==2.
2.0.dev6
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
...
...
tests/python_client/testcases/test_alias.py
浏览文件 @
4d46aa53
...
...
@@ -241,8 +241,8 @@ class TestAliasOperation(TestcaseBase):
# assert insert data
pytest
.
assume
(
insert_data_flag
is
True
and
collection_
alias
.
num_entities
==
ct
.
default_nb
and
collection_
w
.
num_entities
==
ct
.
default_nb
)
collection_
w
.
num_entities
==
ct
.
default_nb
and
collection_
alias
.
num_entities
==
ct
.
default_nb
)
# create index by alias
default_index
=
{
"index_type"
:
"IVF_FLAT"
,
"params"
:
{
"nlist"
:
128
},
"metric_type"
:
"L2"
}
...
...
tests/python_client/testcases/test_collection.py
浏览文件 @
4d46aa53
...
...
@@ -1381,6 +1381,7 @@ class TestCollectionDataframe(TestcaseBase):
res
,
_
=
self
.
collection_wrap
.
construct_from_dataframe
(
cf
.
gen_unique_str
(
prefix
),
df
,
primary_field
=
ct
.
default_int64_field_name
,
auto_id
=
False
)
collection_w
=
res
[
0
]
collection_w
.
flush
()
assert
collection_w
.
num_entities
==
nb
mutation_res
=
res
[
1
]
assert
mutation_res
.
primary_keys
==
df
[
ct
.
default_int64_field_name
].
values
.
tolist
()
...
...
tests/python_client/testcases/test_e2e.py
浏览文件 @
4d46aa53
...
...
@@ -33,9 +33,9 @@ class TestE2e(TestcaseBase):
# flush
t0
=
time
.
time
()
num_entities
,
check_result
=
collection_w
.
flush
(
timeout
=
180
)
_
,
check_result
=
collection_w
.
flush
(
timeout
=
180
)
assert
check_result
assert
num_entities
==
len
(
data
[
0
])
+
entities
assert
collection_w
.
num_entities
==
len
(
data
[
0
])
+
entities
tt
=
time
.
time
()
-
t0
entities
=
collection_w
.
num_entities
log
.
info
(
f
"assert flush:
{
tt
}
, entities:
{
entities
}
"
)
...
...
tests/python_client/testcases/test_index.py
浏览文件 @
4d46aa53
...
...
@@ -90,7 +90,7 @@ class TestIndexParams(TestcaseBase):
ct
.
err_msg
:
f
"cannot create index on non-existed field:
{
f_name
}
"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
# TODO (reason="pymilvus issue #677", raises=TypeError
)
@
pytest
.
mark
.
xfail
(
reason
=
"pymilvus issue 677"
)
@
pytest
.
mark
.
parametrize
(
"index_type"
,
ct
.
get_invalid_strs
)
def
test_index_type_invalid
(
self
,
index_type
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录