exxeleron / qPython

interprocess communication between Python and kdb+
http://www.devnet.de
Apache License 2.0
152 stars 89 forks source link

incorrect handling of tables containing char columns #2

Closed maciejlach closed 10 years ago

maciejlach commented 10 years ago

qPython raises an error while deserializing table containing char column.

Test case:

flip `name`iq`grade!(`Dent`Beeblebrox`Prefect;98 42 126;"a c")

Table meta:

c    | t f a
-----| -----
name | s
iq   | j
grade| c        

Results in:

Traceback (most recent call last):
  File "D:\dev\workspace\qPython\samples\console.py", line 39, in <module>
    result = q(x)
  File "D:\dev\workspace\qPython\qpython\qconnection.py", line 174, in __call__
    return self.sync(parameters[0], *parameters[1:])
  File "D:\dev\workspace\qPython\qpython\qconnection.py", line 146, in sync
    response = self.receive(data_only = False)
  File "D:\dev\workspace\qPython\qpython\qconnection.py", line 169, in receive
    result = self._reader.read(raw)
  File "D:\dev\workspace\qPython\qpython\qreader.py", line 101, in read
    message.data = self.read_data(message.size, raw, message.is_compressed)
  File "D:\dev\workspace\qPython\qpython\qreader.py", line 151, in read_data
    return raw_data if raw else self._read_object()
  File "D:\dev\workspace\qPython\qpython\qreader.py", line 160, in _read_object
    return reader(self, qtype)
  File "D:\dev\workspace\qPython\qpython\qreader.py", line 268, in _read_table
    return qtable(columns, data, qtype = QTABLE)
  File "D:\dev\workspace\qPython\qpython\qcollection.py", line 126, in qtable
    table = numpy.core.records.fromarrays(data, names = ','.join(columns))
  File "C:\Python27\lib\site-packages\numpy\core\records.py", line 562, in fromarrays
    raise ValueError("array-shape mismatch in array %d" % k)
ValueError: array-shape mismatch in array 2