来自kdb的qpython / pandas收到的null字符问题

时间:2016-09-16 16:29:16

标签: python pandas kdb q-lang exxeleron-q

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

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

我正在使用: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'"

当我发送一个具有null char的单行表时,似乎只有一个问题。 没有多个null char可以。单行表和非空字符表没问题。 没有Pandas = True选项,一切都很好(但我的用例需要pandas = True)。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

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

我已经为维护者提供了pull request修复程序。