Cole-Greer commented on code in PR #3396:
URL: https://github.com/apache/tinkerpop/pull/3396#discussion_r3191561969


##########
gremlin-python/src/main/python/gremlin_python/driver/connection.py:
##########
@@ -82,19 +120,57 @@ def cb(f):
 
     def _receive(self):
         try:
-            '''
-            GraphSON does not support streaming deserialization, we are 
aggregating data and bypassing streamed
-             deserialization while GraphSON is enabled for testing. Remove 
after GraphSON is removed.
-            '''
-            self._protocol.data_received_aggregate(self._transport.read(), 
self._result_set)
-            # re-enable streaming after graphSON removal
-            # self._transport.read(self.stream_chunk)
+            # Check for non-GraphBinary error responses
+            status = getattr(self._transport, 'status_code', None)
+            if status is not None and status >= 400:
+                content_type = getattr(self._transport, 'content_type', '')
+                if 'graphbinary' not in content_type:
+                    body = self._transport.read_body().decode('utf-8', 
errors='replace')
+                    raise GremlinServerError({
+                        'code': status,
+                        'message': body,
+                        'exception': ''
+                    })
+
+            # 204 No Content
+            if status == 204:
+                return
+
+            stream = self._transport.get_stream()
+            reader = GraphBinaryReader()

Review Comment:
   This class has `self._response_serializer`, but it isn't used in favour of a 
hardcoded `GraphBinaryReader`. This is somewhat required due to the following 
block which reads the GB header. I think we might need a bit more consideration 
of what the intended behaviour should be here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to