qpython/pandas 从 kdb 收到的空字符问题

Issue with null character received by qpython/pandas from kdb

这个问题几乎是针对@Maciej Lach 的,但如果其他人遇到过这个问题,请告诉我。

问题很简单 - qpyhton 崩溃(当 pandas 设置为 true 时)只要 kdb 向它发送单行 table 其中一列有一个空白字符。

我正在使用:python 版本 2.7.11,qpython 版本 qPython-1.2.0,pandas-0.18.1

重现:

from qpython import qconnection

q = qconnection.QConnection(pandas = True, host = 'myhost', port = myport)

print 'initiating connection(s)'
q.open()

while True:
    msg = q.receive(data_only = True, raw = False)
    print 'message received'

现在,在 kdb 端:

/send a table (which just so happens to have blank/null chars)
neg[4](`upd;`trade;([] col1:`a`b`c;col2:"  a"))
/no problem

/send last row of that table
neg[4](`upd;`trade;-1#([] col1:`a`b`c;col2:"  a"))
/no problem

/send two rows (2 blank chars)
neg[4](`upd;`trade;2#([] col1:`a`b`c;col2:"  a"))
/no problem

/send first row of that table (one blank char)
neg[4](`upd;`trade;1#([] col1:`a`b`c;col2:"  a"))
/crashes with error "AttributeError: 'float' object has no attribute 'meta'"

似乎只有当我发送一个包含空字符的单行 table 时才会出现问题。 多个空字符没问题。具有非空字符的单行 table 没问题。 如果没有 Pandas=True 选项,一切都很好(但我的用例需要 pandas=True)。

有什么想法吗?

这是 qPython 库版本 <1.2.1 中的错误。

我已经向维护者贡献了一个 pull request 修复程序。