Skip to content

Commit

Permalink
Fix drop-graph.py for gremlin_python 3.6.0 (#210)
Browse files Browse the repository at this point in the history
The use of:

    edges = g.E().range(p1,p2).id().toList()
    vertices = g.V().range(p1,p2).id().toList()

does not work work anymore in Python 3 and gremlin_python 3.6.0:

    Exception in thread Thread-1:
    Traceback (most recent call last):
      File "/home/ec2-user/drop.py", line 190, in edge_fetcher
        edges = g.E().range(p1,p2).id().toList()
    TypeError: 'GraphTraversal' object is not callable

Fix is to use:

    edges = g.E().range_(p1,p2).id_().toList()
    vertices = g.V().range_(p1,p2).id_().toList()
  • Loading branch information
metawilm-aws authored Apr 28, 2022
1 parent aaed882 commit 1086074
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drop-graph/drop-graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def edge_fetcher(q,start_offset,bracket_size):
while not success:
print(nm,"[edges] retrieving range ({},{} batch=size={})".format(p1,p2,p2-p1))
try:
edges = g.E().range(p1,p2).id().toList()
edges = g.E().range_(p1,p2).id_().toList()
success = True
except:
print("***",nm,"Exception while fetching. Retrying.")
Expand Down Expand Up @@ -231,7 +231,7 @@ def vertex_fetcher(q,start_offset,bracket_size):
while not success:
print(nm,"[vertices] retrieving range ({},{} batch=size={})".format(p1,p2,p2-p1))
try:
vertices = g.V().range(p1,p2).id().toList()
vertices = g.V().range_(p1,p2).id_().toList()
success = True
except:
print("***",nm,"Exception while fetching. Retrying.")
Expand Down

0 comments on commit 1086074

Please sign in to comment.