2016-09-16 3 views
1

この質問は@Maciej Lachに向けられていますが、他の誰かがこの問題を経験したことがある場合はお知らせください。qpythonがヌル文字を受け取った問題/ kdbのpandas

問題は簡単です.kdbが列の1つに空白の文字がある単一の行テーブルを送信すると、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'" 

私がヌル文字を持つ単一の行のテーブルを送信するときにのみ問題があるように思えます。 複数のヌル文字で問題ありません。これは、nullでないcharを持つ単一の行テーブルで問題ありません。 Pandas = Trueオプションを使用しなくても問題ありません(しかし、私のユースケースではpandas = Trueが必要です)。

アイデア?

答えて

2

qPythonバージョン< 1.2.1のバグです。

私はにメンテナに修正を提供しました。

+0

もう一度ありがとうございます。 – terrylynch

関連する問題