davebshow / goblin

A Python 3.5 rewrite of the TinkerPop 3 OGM Goblin
Other
93 stars 21 forks source link

can not interpret error `unsupported operand type(s) for +: 'float' and 'str'` #86

Closed goern closed 6 years ago

goern commented 6 years ago

while running a short loop I get an error I cant interpret:

$ ./dump_remote_janusgraph.py 
2017-10-23 21:03:11,993,DEBUG,selector_events.py:65,Using selector: EpollSelector
Traceback (most recent call last):
  File "./dump_remote_janusgraph.py", line 44, in <module>
    loop.run_until_complete(dump_all(app))
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "./dump_remote_janusgraph.py", line 33, in dump_all
    async for msg in session.g.V():
  File "/home/goern/Work/thoth/venv/lib/python3.6/site-packages/aiogremlin/gremlin_python/process/traversal.py", line 46, in __anext__
    self.last_traverser = await self.traversers.__anext__()
  File "/home/goern/Work/thoth/venv/lib/python3.6/site-packages/aiogremlin/driver/resultset.py", line 66, in __anext__
    msg = await self.one()
  File "/home/goern/Work/thoth/venv/lib/python3.6/site-packages/aiogremlin/driver/resultset.py", line 10, in wrapper
    msg = await fn(self)
  File "/home/goern/Work/thoth/venv/lib/python3.6/site-packages/aiogremlin/driver/resultset.py", line 86, in one
    loop=self._loop)
  File "/usr/lib64/python3.6/asyncio/tasks.py", line 342, in wait_for
    timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 543, in call_later
    timer = self.call_at(self.time() + delay, callback, *args)
TypeError: unsupported operand type(s) for +: 'float' and 'str'

Here is the loop:

async def dump_all(app):
    session = await app.session()

    async for msg in session.g.V():
        print(msg)

loop = asyncio.get_event_loop()  # pylint: disable=invalid-name

app = loop.run_until_complete(Goblin.open(  # pylint: disable=invalid-name
    loop, get_hashable_id=get_hashable_id, configfile=CONFIG_FILE))
app.register(BinaryPackage, Requires)

loop.run_until_complete(dump_all(app))
davebshow commented 6 years ago

Maybe the response_timeout config parameter is not being properly parsed? Could you please post your config file?

goern commented 6 years ago

None... sounds about wrong... put a 100 in there?

scheme: 'ws'
hosts: ['localhost']
port: 8182
ssl_certfile: ''
ssl_keyfile: ''
ssl_password: ''
username: ''
password: ''
response_timeout: None
max_conns: 4
min_conns: 1
max_times_acquired: 16
max_inflight: 64
message_serializer: 'goblin.driver.GraphSONMessageSerializer'
goern commented 6 years ago

man oh man... thanks for you pair of eyes on my config file!

davebshow commented 6 years ago

It looks like you are using YAML, which I believe requires null instead of None. None would be parsed as the string 'None'. I would just leave this out of the config, and the response_timeout will default to None, unless of course you want a response timeout, which is probably desirable in a production environment. In that case, simply include the key in your config, and pass an int or float.