Any known limit on integer size supported by Gremlin Python for property values?

93 views
Skip to first unread message

Kelvin Lawrence

unread,
May 8, 2019, 12:55:10 PM5/8/19
to Gremlin-users
Using Gremlin Python if I try and set a property value to be 2**31 it fails (what it actually fails with is a long exception unrelated to the number - see below). However trying (2**31)-1 works. The Gremlin Console has no such limitation that I can see. This was quite hard to figure out from the exception as this line was originally part of a much bigger query that was failing.

So this fails using the Python client

g.V('1').property('bignumber', (2**31)).next()

But this works

g.V('1').property('bignumber', (2**31)-1).next()



Here is the actual exception

>>> g.V('1').property('bignumber', (2**31)).next()
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "/usr/local/lib/python3.6/site-packages/gremlin_python/process/traversal.py", line 88, in next
   
return self.__next__()
 
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 432, 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 83, in data_received
    result_set
= results_dict[request_id]
KeyError: None

Cheers,
Kelvin

Kelvin Lawrence

unread,
May 8, 2019, 3:46:20 PM5/8/19
to Gremlin-users
Answering my own observation it seems that explicitly making it a long value works by doing 

long(2**31)


Would be nice to get a more meaningful error message for this.

Cheers
Kelvin
Reply all
Reply to author
Forward
0 new messages