You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 4, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 4, 2022. It is now read-only.
TypeError trying to run simple example from the documentation #85
I was trying to run a simple example from the docs to see if stdnet was usefull for a project but I keep getting a TypeError: <lambda>() takes no arguments (1 given).
The example is this:
from stdnet import odm
class Fund(odm.StdModel):
name = odm.SymbolField(unique=True)
ccy = odm.SymbolField()
description = odm.CharField()
def __unicode__(self):
return self.name
if __name__ == "__main__":
models = odm.Router('redis://localhost:6379')
models.register(Fund)
models.register(Instrument)
models.register(Position)
with models.session().begin() as transaction:
transaction.add(models.fund(name='Markowitz', ccy='EUR'))
And the traceback is this:
(recsys)[/tmp]$ python fund.py
Traceback (most recent call last):
File "fund.py", line 42, in <module>
transaction.add(models.fund(name='Markowitz', ccy='EUR'))
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/odm/session.py", line 434, in __exit__
return self.commit()
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/odm/session.py", line 454, in commit
self.on_result = self._commit()
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/utils/async.py", line 76, in _
return execute_generator(f(*args, **kwargs))
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/utils/async.py", line 40, in execute_generator
result = gen.send(result)
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/odm/session.py", line 471, in _commit
multi.append(backend.execute_session(data))
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/backends/redisb/__init__.py", line 839, in execute_session
return pipe.execute()
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/backends/redisb/client.py", line 350, in execute
raise_on_error=raise_on_error)
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/stdnet/backends/redisb/client.py", line 152, in request_pipeline
conn = self.get_connection('MULTI', pipeline.shard_hint)
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/redis/connection.py", line 874, in get_connection
connection = self.make_connection()
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/redis/connection.py", line 883, in make_connection
return self.connection_class(**self.connection_kwargs)
File "/home/calsaverini/.virtualenvs/recsys/local/lib/python2.7/site-packages/redis/connection.py", line 405, in __init__
self._parser = parser_class(socket_read_size=socket_read_size)
TypeError: <lambda>() takes no arguments (1 given)
I'm pretty sure it must be something dumb I did, but I couldn't find the problem. The version of stdnet is python-stdnet==0.8.2 installed via pip.
changed the title [-]TypeError trying to run simple example from the docs[/-][+]TypeError trying to run simple example from the documentation[/+]on Mar 24, 2015
@mehmetb@rcalsaverini .The same happened to me. So the solution to solve the problems, You better to install the github master branch. you can fix the errors .
Activity
[-]TypeError trying to run simple example from the docs[/-][+]TypeError trying to run simple example from the documentation[/+]mehmetb commentedon Apr 8, 2015
Python-stdnet 0.8.2
Redis 2.8.13
Python 2.7.9 (GCC 4.9.1 on linux2)
Ubuntu 14.10
Exactly the same output for me too
nooperpudd commentedon Aug 15, 2015
@mehmetb @rcalsaverini .The same happened to me. So the solution to solve the problems, You better to install the github master branch. you can fix the errors .