I'm having great trouble adding properties to an edge using the gremlin_python wrapper.
I'm able to create the edge, as so:
eid1='123'
eid2='456'
edge = g.V().has('eid', eid1).addE('transaction').to(g.V().has('entity_id',eid2)).next()
But, adding properties to the edge doesn't work. As in: the code runs without error, but no changes occur on the edge itself, so when after I call g.E(edge).valueMap.toList(), it returns an empty list.
g.E(edge).property('foo','bar').iterate() <-- I've also tried this without iterate.
It also doesn't work if I create the node and add a property on the same line of code.
The same code - but executed in the gremlin console - runs as expected. i.e., after creating the edge and assigning the property:
gremlin> g.E(edge).valueMap().toList()
==>{foo=bar}
Any help here would be greatly appreciated.
Update
I was unable to get this to work using the python wrapper on the graph traversal object, instead I ran the code through the client, which works as expected. But this is a workaround, and not a solution.
gremlin_client = client.Client('ws://localhost:8182/gremlin', 'g')
query = "g.V().has('eid', '123').addE('transaction').to(g.V().has('eid','456')).property('foo','bar').next()"
gremlin_client.submit(query).all().result()
g.E(edge.id()).property(...)? - stephen mallette...edge.id...works in the console, but fails in the same way as described via gremlin_python. - Ian