-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the sqlalchemy demo is broken with python 3.7 #317
Comments
@markwh1te sorry, your fix is incorrect. |
yeah, just as @asvetlov note, with python 3.7, you should change |
If you yield values from an "async function", an AsyncGenerator is returned and everything is fine for python 3.7 But here you intend to return an object that already implements I'm waiting for this fix, also. Are you planning to complete it or I should open my pull request? |
0.0.20 do not fix this, please recheck it:
|
Hello. I'm facing with same problem on version 0.0.20 from class _SAConnectionContextManager(_ContextManager):
async def __aiter__(self):
result = await self._coro
return result Workaroundimport asyncio
from aiomysql.sa import create_engine
async def main():
query = "SELECT table_name FROM information_schema.tables;"
db = await create_engine(user="root", db="db", host="mysql", password="")
async with db.acquire() as conn:
cursor = await conn.execute(query)
async for row in cursor:
print(row)
if __name__ == "__main__":
asyncio.run(main()) UPD. I found a related issue: #410. |
the sqlalchemy demo is broken with python 3.7
The text was updated successfully, but these errors were encountered: