Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1875

Gremlin-Python only aggregates to list when using GraphSON3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.1
    • 3.3.2
    • python
    • None

    Description

      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.

      In general, it seems this value is a bit buried in the new response message format:

      {'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': ''}}
      

      To access it, you have to do something like:

      message['result']['meta']['@value'][1]
      

      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.

      Attachments

        Issue Links

          Activity

            People

              davebshow David Brown
              davebshow David Brown
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: