aio-libs / aioneo4j

asyncio client for neo4j
https://pypi.python.org/pypi/aioneo4j
MIT License
30 stars 10 forks source link

TypeError: timeout() got an unexpected keyword argument 'loop' #13

Open DubrovskijRD opened 2 years ago

DubrovskijRD commented 2 years ago

usage example doesn't work

import asyncio

from aioneo4j import Neo4j

async def go():
    async with Neo4j('http://neo4j:neo4j@127.0.0.1:7474/') as neo4j:
        data = await neo4j.data()
        assert bool(data)

loop = asyncio.get_event_loop()
loop.run_until_complete(go())
loop.close()

got exception:

  File "venv/lib/python3.8/site-packages/aioneo4j/client.py", line 56, in data
    _, data = await self.transport.perform_request(
  File "venv/lib/python3.8/site-packages/aioneo4j/transport.py", line 149, in perform_request
    with async_timeout.timeout(_request_timeout, loop=self.loop):
TypeError: timeout() got an unexpected keyword argument 'loop'
sys:1: RuntimeWarning: coroutine 'Transport._perform_request' was never awaited

replace with async_timeout.timeout(_request_timeout, loop=self.loop) -> with async_timeout.timeout(_request_timeout) fixed this error

CostantinKW commented 2 years ago

you are right! This bug report still exists, replace with async_timeout.timeout(_request_timeout, loop=self.loop) -> with async_timeout.timeout(_request_timeout) fixed this error