driftx/Telephus — Issue #28: TypeError: an integer is required in batch_mutate
Author: dizpers
Created: 2012-03-05 18:57:31+00:00
State: open

Hi! I use the following function to create a new user:

def createUser(self, identity, email, fname, lname, mname):
cols = [
Column(name="email", value=email, timestamp=datetime.datetime.now()),
Column(name="fname", value=fname, timestamp=datetime.datetime.now()),
Column(name="lname", value=lname, timestamp=datetime.datetime.now()),
Column(name="mname", value=mname, timestamp=datetime.datetime.now())
]
return self.db.batch_mutate(mutationmap={identity: {"users": cols}})

But after calling it I have an error. Stack trace:

Traceback (most recent call last):
File "server.py", line 100, in handle_request
res = yield self.backend.createUser(identity, email, fname, lname, mname)
File "/usr/local/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-freebsd-8.2-STABLE-amd64.egg/twisted/internet/defer.py", line 545, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "build/bdist.freebsd-8.2-STABLE-amd64/egg/telephus/pool.py", line 301, in
d.addCallback(lambda _: method(*req.args))
File "build/bdist.freebsd-8.2-STABLE-amd64/egg/telephus/cassandra/Cassandra.py", line 823, in batch_mutate
self.send_batch_mutate(mutation_map, consistency_level)
File "build/bdist.freebsd-8.2-STABLE-amd64/egg/telephus/cassandra/Cassandra.py", line 832, in send_batch_mutate
args.write(oprot)
File "build/bdist.freebsd-8.2-STABLE-amd64/egg/telephus/cassandra/Cassandra.py", line 4423, in write
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
TypeError: an integer is required

What can cause the problem?