[ 
https://issues.apache.org/jira/browse/TINKERPOP-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette closed TINKERPOP-1859.
---------------------------------------
    Resolution: Fixed
      Assignee: stephen mallette

This is resolve now because of TINKERPOP-1894 :

{code}
>>> g.V().hasLabel("person").has("age", 
>>> P.not_(P.lte(10).and_(P.not_(P.between(11, 
>>> 20)))).and_(P.lt(29).or_(P.eq(35)))).values("name").toList()
[u'vadas', u'peter']
{code}

> Complex instance of P not serializing to bytecode properly
> ----------------------------------------------------------
>
>                 Key: TINKERPOP-1859
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1859
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 3.2.7
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>            Priority: Major
>             Fix For: 3.2.8, 3.3.2
>
>
> Not sure what's happening but this traversal does not return any results with 
> gremlin-python:
> {code}
> gremlin> g.V().hasLabel("person").has("age", 
> P.not(P.lte(10).and(P.not(P.between(11, 
> 20)))).and(P.lt(29).or(P.eq(35)))).values("name")
> ==>vadas
> ==>peter
> {code}
> When looking at the bytecode the python bytecode is different from the java 
> bytecode. The java bytecode for the predicate is:
> {code}
> {
>       "@type": "g:P",
>       "@value": {
>               "predicate": "and",
>               "value": [{
>                       "@type": "g:P",
>                       "@value": {
>                               "predicate": "or",
>                               "value": [{
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "gt",
>                                               "value": {
>                                                       "@type": "g:Int32",
>                                                       "@value": 10
>                                               }
>                                       }
>                               }, {
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "and",
>                                               "value": [{
>                                                       "@type": "g:P",
>                                                       "@value": {
>                                                               "predicate": 
> "gte",
>                                                               "value": {
>                                                                       
> "@type": "g:Int32",
>                                                                       
> "@value": 11
>                                                               }
>                                                       }
>                                               }, {
>                                                       "@type": "g:P",
>                                                       "@value": {
>                                                               "predicate": 
> "lt",
>                                                               "value": {
>                                                                       
> "@type": "g:Int32",
>                                                                       
> "@value": 20
>                                                               }
>                                                       }
>                                               }]
>                                       }
>                               }]
>                       }
>               }, {
>                       "@type": "g:P",
>                       "@value": {
>                               "predicate": "or",
>                               "value": [{
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "lt",
>                                               "value": {
>                                                       "@type": "g:Int32",
>                                                       "@value": 29
>                                               }
>                                       }
>                               }, {
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "eq",
>                                               "value": {
>                                                       "@type": "g:Int32",
>                                                       "@value": 35
>                                               }
>                                       }
>                               }]
>                       }
>               }]
>       }
> }
> {code}
> The python bytecode is:
> {code}
> {
>       "@type": "g:P",
>       "@value": {
>               "predicate": "and",
>               "value": [{
>                       "@type": "g:P",
>                       "@value": {
>                               "predicate": "not",
>                               "value": {
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "and",
>                                               "value": [{
>                                                       "@type": "g:P",
>                                                       "@value": {
>                                                               "predicate": 
> "lte",
>                                                               "value": {
>                                                                       
> "@type": "g:Int64",
>                                                                       
> "@value": 10
>                                                               }
>                                                       }
>                                               }, {
>                                                       "@type": "g:P",
>                                                       "@value": {
>                                                               "predicate": 
> "not",
>                                                               "value": {
>                                                                       
> "@type": "g:P",
>                                                                       
> "@value": {
>                                                                               
> "predicate": "between",
>                                                                               
> "value": [{
>                                                                               
>         "@type": "g:Int64",
>                                                                               
>         "@value": 11
>                                                                               
> }, {
>                                                                               
>         "@type": "g:Int64",
>                                                                               
>         "@value": 20
>                                                                               
> }]
>                                                                       }
>                                                               }
>                                                       }
>                                               }]
>                                       }
>                               }
>                       }
>               }, {
>                       "@type": "g:P",
>                       "@value": {
>                               "predicate": "or",
>                               "value": [{
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "lt",
>                                               "value": {
>                                                       "@type": "g:Int64",
>                                                       "@value": 29
>                                               }
>                                       }
>                               }, {
>                                       "@type": "g:P",
>                                       "@value": {
>                                               "predicate": "eq",
>                                               "value": {
>                                                       "@type": "g:Int64",
>                                                       "@value": 35
>                                               }
>                                       }
>                               }]
>                       }
>               }]
>       }
> }
> {code}
> This fix should likely be applied as part of TINKERPOP-1857 (or after it is 
> merged) as there were a few modifications in that branch around {{P}} to 
> resolve other issues.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to