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

Metaproperties example in docs fails #70

Closed
John-Boik opened this issue Aug 17, 2017 · 3 comments
Closed

Metaproperties example in docs fails #70

John-Boik opened this issue Aug 17, 2017 · 3 comments

Comments

@John-Boik
Copy link

It appears that the example code in the docs fails for metaproperties, at least on my system.

Here is my code, copied from the web docs:

import goblin
from aiogremlin.gremlin_python import Cardinality

class HistoricalName(goblin.VertexProperty):
    notes = goblin.Property(goblin.String)

class City(goblin.Vertex):
    name = goblin.Property(goblin.String)
    population = goblin.Property(goblin.Integer)
    historical_name = HistoricalName(
        goblin.String, card=Cardinality.list)

When I run this script, I get the error:

  File "/usr/lib/python3.5/enum.py", line 274, in __getattr__
    raise AttributeError(name) from None
AttributeError: list 

I'm using goblin 2.0.0, gremlin-python 3.2.5, aiogremlin 3.2.4.

@John-Boik
Copy link
Author

The error seems to be with Cardinality. This causes the same error:

from aiogremlin.gremlin_python import Cardinality
Cardinality.list

Also, the same error is caused if Cardinality is imported as:
from gremlin_python.process.traversal import Cardinality
Any ideas for a workaround?

@John-Boik
Copy link
Author

OK, easy fix. It seems that gremlin_python has changed Cardinality recently. Now it must be invoked as:
Cardinality.list_

@davebshow
Copy link
Owner

Ok I will go ahead and close this then.

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

2 participants