GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/814

    TINKERPOP-1896 Fixed bug in lambda processing for python

    https://issues.apache.org/jira/browse/TINKERPOP-1896
    
    When a lambda is in a traversal, the bytecode gets pushed to a scriptengine 
for evaluation. For python that means, using the JythonTranslator. Prior to 
this change the JythonTranslator largely relied on the PythonTranslator to 
convert bytecode to Jython-syntaxed Gremlin. The problem there is that in the 
JythonScriptEngine, the Traversal bindings are Java objects and so if 
translated to pure Python syntax, traversal steps like as() become as_() and 
thus not part of the Java API that is expected - and then errors. Not sure why 
this didn't come up sooner, but it really only ends up being an issue if you 
are using bytecode, use gremlin server, use jython in gremlin server and then 
submit a traversal with a lambda - so perhaps that hasn't been a common 
combination.
    
    All tests pass with `docker/build.sh -t -i`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1896

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/814.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #814
    
----
commit 5c5df83e71ab0071c1d073a2ca68c5822ea9336d
Author: Stephen Mallette <spmva@...>
Date:   2018-03-08T22:15:34Z

    TINKERPOP-1896 Fixed bug in lambda processing for python
    
    When a lambda is in a traversal, the bytecode gets pushed to a scriptengine 
for evaluation. For python that means, using the JythonTranslator. Prior to 
this change the JythonTranslator largely relied on the PythonTranslator to 
convert bytecode to Jython-syntaxed Gremlin. The problem there is that in the 
JythonScriptEngine, the Traversal bindings are Java objects and so if 
translated to pure Python syntax, traversal steps like as() become as_() and 
thus not part of the Java API that is expected - and then errors. Not sure why 
this didn't come up sooner, but it really only ends up being an issue if you 
are using bytecode, use gremlin server, use jython in gremlin server and then 
submit a traversal with a lambda - so perhaps that hasn't been a common 
combination.

----


---

Reply via email to