PartitionStrategy from Python

117 views
Skip to first unread message

Kelvin Lawrence

unread,
Mar 29, 2019, 1:37:20 PM3/29/19
to Gremlin-users
PartitionStrategy works for me from Java but I have not managed to get it to work from Python. I have looked at the source code and as far as I can tell I have the correct parameters. I could not find any mention of PartitionStrategy in the Gremlin Python tests but maybe I missed it. I'm using the 3.4.1 level of Gremlin Python from 'pip install'.

When I try and use the below, Gremlin Server immediately returns with a 599 and and no other message.

strat1 = PartitionStrategy(partition_key="partition",
                           write_partition
="a",
                           read_partitions
="a")
g2
= g.withStrategies(strat1)
# This line fails
x
= g2.addV('test').property("p1",1).next()
print(x)


#g2.V('test').valueMap().next()

Here is the exception:

Traceback (most recent call last):
 
File "partition.py", line 37, in <module>
    x
= g2.addV('test').property("p1",1).toList()
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py", line 57, in toList
   
return list(iter(self))
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py", line 47, in __next__
   
self.traversal_strategies.apply_strategies(self)
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py", line 506, in apply_strategies
    traversal_strategy
.apply(traversal)
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/remote_connection.py", line 148, in apply
    remote_traversal
= self.remote_connection.submit(traversal.bytecode)
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/driver_remote_connection.py", line 54, in submit
    results
= result_set.all().result()
 
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
   
return self.__get_result()
 
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
   
raise self._exception
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/resultset.py", line 90, in cb
    f
.result()
 
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 425, in result
   
return self.__get_result()
 
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
   
raise self._exception
 
File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result
= self.fn(*self.args, **self.kwargs)
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/connection.py", line 80, in _receive
    status_code
= self._protocol.data_received(data, self._results)
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 110, in data_received
   
raise GremlinServerError(message["status"])
gremlin_python
.driver.protocol.GremlinServerError: 599: None





Thanks in advance for any tips/pointers.

Cheers,
Kelvin

Stephen Mallette

unread,
Mar 30, 2019, 10:29:30 AM3/30/19
to gremli...@googlegroups.com
could just be a bug.........we still seem to run into odd bugs in GLVs with certain strategies. usually some deficiency in serialization. you might need to open a ticket with some repro steps....

i assume your comment on 


isn't related to this issue?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/55b6f9f5-5d34-47cd-87fb-b1537bf87343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kelvin Lawrence

unread,
Mar 30, 2019, 11:19:10 AM3/30/19
to Gremlin-users
Hi Stephen. I can open a ticket. Basically the Python code I shared from any Python app connected to any Gremlin server should show the problem. Graph can be an empty TinkerGraph.

Re the other issue. No different problem. Using 3.4.1, traversals with addE at the front from Java still do not add the partition property and I was not sure from the Jira if that fix made 3.4.1.

Cheers
Kelvin

Reply all
Reply to author
Forward
0 new messages