Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Rattenking
TDengine
提交
9f519002
T
TDengine
项目概览
Rattenking
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9f519002
编写于
8月 31, 2021
作者:
Z
Zhang Lianlei
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/develop' into develop
上级
ef1a97f4
2483985d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
13 deletion
+18
-13
src/connector/python/taos/cinterface.py
src/connector/python/taos/cinterface.py
+8
-11
tests/pytest/util/sql.py
tests/pytest/util/sql.py
+10
-2
未找到文件。
src/connector/python/taos/cinterface.py
浏览文件 @
9f519002
...
...
@@ -102,9 +102,7 @@ _libtaos.taos_get_client_info.restype = c_char_p
def
taos_get_client_info
():
# type: () -> str
"""Get client version info.
获取客户端版本信息。
"""
"""Get client version info."""
return
_libtaos
.
taos_get_client_info
().
decode
()
...
...
@@ -114,6 +112,7 @@ _libtaos.taos_get_server_info.argtypes = (c_void_p,)
def
taos_get_server_info
(
connection
):
# type: (c_void_p) -> str
"""Get server version as string."""
return
_libtaos
.
taos_get_server_info
(
connection
).
decode
()
...
...
@@ -134,11 +133,10 @@ _libtaos.taos_connect.argtypes = c_char_p, c_char_p, c_char_p, c_char_p, c_uint1
def
taos_connect
(
host
=
None
,
user
=
"root"
,
password
=
"taosdata"
,
db
=
None
,
port
=
0
):
# type: (None|str, str, str, None|str, int) -> c_void_p
"""Create TDengine database connection.
创建数据库连接,初始化连接上下文。其中需要用户提供的参数包含:
- host: server hostname/FQDN
, TDengine管理主节点的FQDN
- user: user name
/用户名
- password: user password
/ 用户密码
- host: server hostname/FQDN
- user: user name
- password: user password
- db: database name (optional)
- port: server port
...
...
@@ -187,11 +185,10 @@ _libtaos.taos_connect_auth.argtypes = c_char_p, c_char_p, c_char_p, c_char_p, c_
def
taos_connect_auth
(
host
=
None
,
user
=
"root"
,
auth
=
""
,
db
=
None
,
port
=
0
):
# type: (None|str, str, str, None|str, int) -> c_void_p
"""
创建数据库连接,初始化连接上下文。其中需要用户提供的参数包含:
"""Connect server with auth token.
- host: server hostname/FQDN
, TDengine管理主节点的FQDN
- user: user name
/用户名
- host: server hostname/FQDN
- user: user name
- auth: base64 encoded auth token
- db: database name (optional)
- port: server port
...
...
tests/pytest/util/sql.py
浏览文件 @
9f519002
...
...
@@ -21,7 +21,15 @@ import shutil
import
pandas
as
pd
from
util.log
import
*
def
_parse_datetime
(
timestr
):
try
:
return
datetime
.
datetime
.
strptime
(
timestr
,
'%Y-%m-%d %H:%M:%S.%f'
)
except
ValueError
:
pass
try
:
return
datetime
.
datetime
.
strptime
(
timestr
,
'%Y-%m-%d %H:%M:%S'
)
except
ValueError
:
pass
class
TDSql
:
def
__init__
(
self
):
...
...
@@ -181,7 +189,7 @@ class TDSql:
tdLog
.
info
(
"sql:%s, row:%d col:%d data:%d == expect:%s"
%
(
self
.
sql
,
row
,
col
,
self
.
queryResult
[
row
][
col
],
data
))
else
:
if
self
.
queryResult
[
row
][
col
]
==
datetime
.
datetime
.
fromisoformat
(
data
):
if
self
.
queryResult
[
row
][
col
]
==
_parse_datetime
(
data
):
tdLog
.
info
(
"sql:%s, row:%d col:%d data:%s == expect:%s"
%
(
self
.
sql
,
row
,
col
,
self
.
queryResult
[
row
][
col
],
data
))
return
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录