Skip to content
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

AttributeError: AsyncGraphTraversal.last_traverser #96

Closed
grvhi opened this issue Jan 12, 2018 · 1 comment
Closed

AttributeError: AsyncGraphTraversal.last_traverser #96

grvhi opened this issue Jan 12, 2018 · 1 comment

Comments

@grvhi
Copy link

grvhi commented Jan 12, 2018

I'm sure I'm missing a step somewhere, but I can't immediately establish what I'm doing wrong from the docs. Here is my sample code to reproduce the problem, followed by the traceback and the output from pip freeze. Any tips gratefully received!

    import asyncio

    from goblin import Goblin


    class City(goblin.Vertex):
        value = goblin.Property(goblin.String)


    loop = asyncio.get_event_loop()
    app = loop.run_until_complete(
        Goblin.open(loop, hosts=['neptune.opendna.internal'])
    )
    app.register(City)
    session = loop.run_until_complete(app.session())  # type: Session

    async def save_location(obj):
        session.add(obj)
        return await session.flush()

    city = City()
    city.value = 'Cape Town'
    loop.run_until_complete(save_location(city))
Traceback (most recent call last):
  File "/Users/george/sites/odna-neptune/vesta/vertices/location.py", line 54, in <module>
    loop.run_until_complete(save_location(city))
  File "/Users/george/.pyenv/versions/3.6.0/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "/Users/george/sites/odna-neptune/vesta/vertices/location.py", line 50, in save_location
    return await session.flush()
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 242, in flush
    await self.save(elem)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 292, in save
    result = await self.save_vertex(elem)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 311, in save_vertex
    self._update_vertex)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 412, in _save_element
    result = await create_func(elem)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 419, in _add_vertex
    return await self._add_properties(traversal, props, vertex)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 473, in _add_properties
    return await self._simple_traversal(traversal, elem)
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/goblin/session.py", line 388, in _simple_traversal
    elem = await traversal.next()
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/aiogremlin/process/graph_traversal.py", line 56, in next
    return await self.__anext__()
  File "/Users/george/sites/odna-neptune/venv/lib/python3.6/site-packages/aiogremlin/process/graph_traversal.py", line 18, in __anext__
    object = self.last_traverser.object
AttributeError: 'str' object has no attribute 'object'
aenum==1.4.5
aiogremlin==3.2.5
aiohttp==1.3.3
async-timeout==2.0.0
chardet==3.0.4
Cython==0.27.3
goblin==2.1.0
gremlinpython==3.3.1
idna==2.6
inflection==0.3.1
multidict==3.3.2
PyYAML==3.12
six==1.10.0
tornado==4.5.2
ujson==1.35
uvloop==0.9.1
yarl==0.9.8
@grvhi
Copy link
Author

grvhi commented Jan 12, 2018

Apologies, closing and creating in the aiogremlin repo: davebshow/aiogremlin#14

@grvhi grvhi closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant