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 has been archived by the owner on Aug 4, 2022. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
rcalsaverini
changed the title
TypeError trying to run simple example from the docs
TypeError trying to run simple example from the documentation
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 .
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there.
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:
And the traceback is this:
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.The text was updated successfully, but these errors were encountered: