05bit / peewee-async

Asynchronous interface for peewee ORM powered by asyncio
http://peewee-async-lib.readthedocs.io
MIT License
733 stars 100 forks source link

AssertionError when trying execute ModelCompoundSelectQuery #111

Open iurii-iurii opened 5 years ago

iurii-iurii commented 5 years ago
  File "/usr/local/lib/python3.7/site-packages/peewee_async.py", line 258, in execute
    return (await execute(query))
  File "/usr/local/lib/python3.7/site-packages/peewee_async.py", line 395, in execute
    return (await coroutine(query))
  File "/usr/local/lib/python3.7/site-packages/peewee_async.py", line 640, in raw_query
    "with wrong query class %s" % str(query))
AssertionError: Error, trying to run delete coroutinewith wrong query class <peewee.ModelCompoundSelectQuery object at 
rudyryk commented 5 years ago

Need a source code sample to reproduce.

msea1 commented 3 years ago

Cannot comment on OP due to lack of context, but related to this, there is a bug in the error message

async def raw_query(query):
    assert isinstance(query, peewee.RawQuery),\
        ("Error, trying to run delete coroutine"
         "with wrong query class %s" % str(query))

"run delete coroutine" should be "run raw_query coroutine"