exxeleron / qPython

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

qPython 1.1 dev fails for synchronous function with parameter: #25

Closed beebeed closed 8 years ago

beebeed commented 9 years ago

Running qPython 1.1 dev fails when running

print q.sync('{til x}', 10)

it generates the following error

print(q.sync('{til x}', 10))
File "C:\Python3403_64\lib\site-packages\qpython\qconnection.py", line 268, in sync
    response = self.receive(data_only = False, **options)
File "C:\Python3403_64\lib\site-packages\qpython\qconnection.py", line 341, in receive
    result = self._reader.read(**self._options.union_dict(**options))
File "C:\Python3403_64\lib\site-packages\qpython\qreader.py", line 151, in read
    message.data = self.read_data(message.size, message.is_compressed, **options)
File "C:\Python3403_64\lib\site-packages\qpython\qreader.py", line 228, in read_data
    return raw_data if options.raw else self._read_object(options)
File "C:\Python3403_64\lib\site-packages\qpython\qreader.py", line 237, in _read_object
    return reader(self, qtype, options)
File "C:\Python3403_64\lib\site-packages\qpython\qreader.py", line 248, in _read_error
    raise QException(self._read_symbol(options = options))
qpython.qtype.QException: b'type'

Environment: Windows 7 64 bit, Python 3.4, qpython 1.1 dev

This query works for Python 2.7, qpython 1.0

Kind regard

David Bieber

maciejlach commented 9 years ago

Could you please provide us with additional details on Python and numpy version in your setup?

I failed to reproduce the issue in my Python 3.4 environment:

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32

OS Name:                   Microsoft Windows 8.1 Pro
OS Version:                6.3.9600 N/A Build 9600

Numpy (installed with pip from Unofficial Windows Binaries for Python Extension Packages):

numpy-1.9.2+mkl-cp34-none-win_amd64

Code has been executed against kdb+ versions:

w32/ KDB+ 3.1 2014.07.01 Copyright (C) 1993-2014 Kx Systems
l64/ KDB+ 3.2 2014.08.22 Copyright (C) 1993-2014 Kx Systems

Reported error indicates that the function parameter 10 has been serialized into IPC protocol as a non-integer value.

beebeed commented 9 years ago

Thanks for looking into this for me

I am using

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32
OS Name: Microsoft Windows 7 Pro
OS Version: Version 6.1.7601

Numpy (also installed with pip from Unofficial Windows Binaries for Python Extension Packages):

numpy-1.9.2+mkl-cp34-none-win_amd64

The code was excuted against an older version of 64 bit KDB

w64/ KDB+ 2.7 2011.11.18 Copyright (C) 1993-2011 Kx Systems

Kind regards

David

beebeed commented 9 years ago

FYI ...

I just tried the trial version of kdb+ w32/ KDB+ 3.3 2015.07.09 and it works.

maciejlach commented 9 years ago

To summarize all the findings:

You can force the qpython to serialize this parameter to 32 bit with following syntax:

print(q.sync('{til x}', numpy.int32(10)))
beebeed commented 8 years ago

Thanks Maciej,

That now works with kdb 2.7+

Regards

David