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
Traceback (most recent call last):
File "test.py", line 19, in <module>
loop.run_until_complete(main())
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "test.py", line 6, in main
val = await pg.insert('INSERT INTO users (nickname) VALUES ($1)', 'fantix')
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpgsa/pgsingleton.py", line 91, in insert
timeout=timeout)
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpgsa/connection.py", line 138, in insert
return await self.fetchval(query, *params, *args, **kwargs)
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpgsa/connection.py", line 123, in fetchval
return await super().fetchval(query, *args, **kwargs)
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpg/connection.py", line 358, in fetchval
data = await self._execute(query, args, 1, timeout)
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpg/connection.py", line 1188, in _execute
return await self._do_execute(query, executor, timeout)
File "/Volumes/Home/fantix/py36env/lib/python3.6/site-packages/asyncpg/connection.py", line 1209, in _do_execute
result = await executor(stmt, None)
File "asyncpg/protocol/protocol.pyx", line 181, in bind_execute (asyncpg/protocol/protocol.c:66715)
File "asyncpg/protocol/prepared_stmt.pyx", line 103, in asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg (asyncpg/protocol/protocol.c:62407)
ValueError: number of arguments (0) does not match number of parameters (1)
Looks like the overriden _execute method simply ignored the given args but only make use of the args found in the query object - if query is one:
The same happens with insert when using a SQLAlchemy core insert statement object with values included. Because the compile is done in insert, before _execute.
The text was updated successfully, but these errors were encountered:
fantix
added a commit
to fantix/asyncpgsa
that referenced
this issue
Jul 21, 2017
pg.insert
simply doesn't work:Looks like the overriden
_execute
method simply ignored the givenargs
but only make use of theargs
found in thequery
object - ifquery
is one:The same happens with
insert
when using a SQLAlchemy core insert statement object with values included. Because the compile is done ininsert
, before_execute
.The text was updated successfully, but these errors were encountered: