Open echennh-zz opened 2 years ago
There was a change made in Apache TinkerPop 3.6. In that release of the Python client all the names of Gremlin steps that conflict with Python reserved words were removed and replaced with ones of the form range_
. In the 3.5.x TinkerPop versions both forms existed (eg range
and range_
) but the range
form was declared deprecated. I think the gremlin_utils.py code needs to probably be version aware and not even try to delete any globals if the gremlin-python version is 3.6.0 or higher. Thanks for pointing out this issue.
The version of the client can be checked using something like this:
from gremlin_python import __version__ as gremv
print(gremv.version)
I am getting the same error. Client version 3.6.0
it looks like this update get you pass this error
del globals['range_']
del globals['map']
del globals['min']
del globals['sum_']
del globals['property']
del globals['max_']
I'm not sure how to bypass this error. Temporarily I'm doing this (very bad) practice which seems to work. Highly NOT recommended.
globs_to_delete = ['range', 'map', 'min', 'sum', 'property', 'max']
for glob in globs_to_delete:
if glob not in globals():
globals()[glob] = glob
GremlinUtils.init_statics(globals())
In the
__init_statics()
method of GremlinUtils in neptune_python_utils/gremlin_utils.py, the code: https://github.com/awslabs/amazon-neptune-tools/blob/a1d67b1f1f7cfefa4e3c01fd4ad0566da5c3ac1d/neptune-python-utils/neptune_python_utils/gremlin_utils.py#L41 leads to a KeyError if the global doesn't already exist. I believe this should be changed to:which has patched the problem in my app's version of neptune_python_utils.