From aaf571f17767708a678e8c684568fa92e15658bb Mon Sep 17 00:00:00 2001 From: davebshow <davebshow@gmail.com> Date: Thu, 18 Jan 2018 17:55:43 -0800 Subject: [PATCH] getting ready for 3.3.0 release --- aiogremlin/driver/protocol.py | 22 ++++++++++++++++------ requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/aiogremlin/driver/protocol.py b/aiogremlin/driver/protocol.py index 97f1292..277dc36 100644 --- a/aiogremlin/driver/protocol.py +++ b/aiogremlin/driver/protocol.py @@ -50,9 +50,13 @@ class GremlinServerWSProtocol(protocol.AbstractBaseProtocol): msg = message['status']['message'] if request_id in results_dict: result_set = results_dict[request_id] - aggregate_to = message['result']['meta'].get('aggregateTo', - 'list') + meta_aggregate_to = message['result']['meta']['@value'] + if len(meta_aggregate_to) > 1: + aggregate_to = meta_aggregate_to[1] + else: + aggregate_to = 'list' result_set.aggregate_to = aggregate_to + if status_code == 407: auth = b''.join([b'\x00', self._username.encode('utf-8'), b'\x00', self._password.encode('utf-8')]) @@ -64,10 +68,16 @@ class GremlinServerWSProtocol(protocol.AbstractBaseProtocol): result_set.queue_result(None) else: if data: - for result in data: - result = self._message_serializer.deserialize_message(result) - message = Message(status_code, result, msg) - result_set.queue_result(message) + if self._message_serializer.version == b"application/vnd.gremlin-v2.0+json": + for result in data: + result = self._message_serializer.deserialize_message(result) + message = Message(status_code, result, msg) + result_set.queue_result(message) + else: + results = self._message_serializer.deserialize_message(data['@value']) + for result in results: + message = Message(status_code, result, msg) + result_set.queue_result(message) else: data = self._message_serializer.deserialize_message(data) message = Message(status_code, data, msg) diff --git a/requirements.txt b/requirements.txt index f5fd80c..efdf340 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -gremlinpython==3.2.6 +gremlinpython==3.3.0 diff --git a/setup.py b/setup.py index 93ba86e..307536f 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='aiogremlin', - version='3.2.7', + version='3.3.0', url='', license='Apache Software License', author='davebshow', -- GitLab