2016-09-16 49 views
1

这个问题很直接针对@Maciej Lach,但如果有其他人遇到过这个问题,请告诉我。qpython/pandas从kdb收到的空字符问题

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

我使用:Python版本2.7.11,qpython版本qPython-1.2.0,熊猫-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'" 

这似乎只有一个问题,当我发送一个单行表,其中有一个空字符。 有多个空字符就可以了。使用非空字符的单行表格很好。 没有Pandas = True选项,一切都很好(但我需要pandas = True用于我的用例)。

任何想法?

回答

2

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

我已经为维护者修复了一个pull request

+0

辉煌,再次感谢。 – terrylynch