Hello,
We've noticed something that we think is a bug with the Python API.
If you do a write call with a value that is a list of integers via the
python api and then do a read call on that same key the resultant
object is unicode, not a list. If you do this write/read call with a
list of strings, the resultant object is a list. Here is a sample test
case that has this behavior. Is this to be expected?
>>>x = JSONConnection(url=database)
>>>y= TransactionSingleOp(x)
>>>y.write('xxx', ['1'])
>>>y.read('xxx')
[u'1']
>>>y.write('xxx', ['1','2'])
>>>z=y.read('xxx')
>>>z
[u'1', u'2']
>>>type(z)
<type 'list'>
>>>y.write('xxx', [1,2,3])
>>>z=y.read('xxx')
>>>z
>>>type(z)
<type 'unicode'>
--------------------------------------------------------------------------------
An exception happens when you try with a list of floats:
x = JSONConnection(url=self.database)
y= TransactionSingleOp(x)
y.write('xxx',[1.0,2.0,3.0])
y.read('xxx')
Traceback (most recent call last):
File "/Users/asgillmor/Applications/eclipse/plugins/
org.python.pydev.debug_1.6.3.2010100513/pysrc/pydevd_comm.py", line
685, in doIt
result = pydevd_vars.evaluateExpression(self.thread_id,
self.frame_id, self.expression, self.doExec)
File "/Users/asgillmor/Applications/eclipse/plugins/
org.python.pydev.debug_1.6.3.2010100513/pysrc/pydevd_vars.py", line
369, in evaluateExpression
result = eval(compiled, updated_globals, frame.f_locals)
File "<string>", line 1, in <module>
File "/Users/asgillmor/Documents/nosql/py-tpcc/pytpcc/drivers/api/
Scalaris.py", line 375, in read
result = self._conn.call('read', [key])
File "/Users/asgillmor/Documents/nosql/py-tpcc/pytpcc/drivers/api/
Scalaris.py", line 79, in call
raise ConnectionException(instance)
ConnectionException: ConnectionException()
There is exception on the server as well:
http://pastebin.com/LrdnsJ8M
It should be noted that reading these values via the web interface
looks fine.
Best,
Alex