[ 
https://issues.apache.org/jira/browse/TINKERPOP-1875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343822#comment-16343822
 ] 

ASF GitHub Bot commented on TINKERPOP-1875:
-------------------------------------------

Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/790#discussion_r164529296
  
    --- Diff: gremlin-python/src/main/jython/tests/conftest.py ---
    @@ -1,4 +1,4 @@
    -'''
    +"""
    --- End diff --
    
    i'm fine with adhering to the style guides. perhaps just do it 
consistently? perhaps CTR in fixes across the board for all the license 
headers, so that it's not just in this one file.


> Gremlin-Python only aggregates to list when using GraphSON3
> -----------------------------------------------------------
>
>                 Key: TINKERPOP-1875
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1875
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 3.3.1
>            Reporter: David M. Brown
>            Assignee: David M. Brown
>            Priority: Major
>             Fix For: 3.3.2
>
>
> Gremlin-Python fails to correctly extract the aggregate_to value from the 
> Gremlin Server response when using GraphSON3. I believe this is the source of 
> the test failures that were temporarily fixed by using the v2.0 message 
> serializer in [this 
> commit|https://github.com/apache/tinkerpop/commit/8c299879e777765748c2c2b03a58b6d0c5c401de].
>  
> In general, it seems this value is a bit buried in the new response message 
> format:
> {code:json}
> {'requestId': 'b2a51ad2-bca6-4493-9115-a57a92e477c7',
>  'result': {'data': {'@type': 'g:List',
>    '@value': [{'@type': 'g:Map',
>      '@value': ['ripple', {'@type': 'g:Int64', '@value': 1}]},
>     {'@type': 'g:Map', '@value': ['lop', {'@type': 'g:Int64', '@value': 
> 3}]}]},
>   'meta': {'@type': 'g:Map',
>    '@value': ['aggregateTo', 'map', 'sideEffectKey', 'm']}},
>  'status': {'attributes': {'@type': 'g:Map', '@value': []},
>   'code': 200,
>   'message': ''}}
> {code}
> To access it, you have to do something like:
> {code:python}
> message['result']['meta']['@value'][1]
> {code}
> Which throws an error when no metadata is present. This seems a bit clumsy. I 
> haven't looked at how the Java driver deals with it, maybe there is a better 
> way to parse this.



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

Reply via email to