vkagamlyk commented on code in PR #2702:
URL: https://github.com/apache/tinkerpop/pull/2702#discussion_r1700688808


##########
gremlin-python/src/main/python/gremlin_python/driver/driver_remote_connection.py:
##########
@@ -106,22 +108,26 @@ def cb(f):
     def is_closed(self):
         return self._client.is_closed()
 
-    def commit(self):
-        log.info("Submitting commit graph operation.")
-        return self._client.submit(Bytecode.GraphOp.commit())
-
-    def rollback(self):
-        log.info("Submitting rollback graph operation.")
-        return self._client.submit(Bytecode.GraphOp.rollback())
+    # TODO remove or update once HTTP transaction is implemented
+    # def commit(self):
+    #     log.info("Submitting commit graph operation.")
+    #     return self._client.submit(Bytecode.GraphOp.commit())
+    #
+    # def rollback(self):
+    #     log.info("Submitting rollback graph operation.")
+    #     return self._client.submit(Bytecode.GraphOp.rollback())
 
     @staticmethod
-    def _extract_request_options(bytecode):
-        options_strategy = next((x for x in bytecode.source_instructions
-                                 if x[0] == "withStrategies" and type(x[1]) is 
OptionsStrategy), None)
+    def extract_request_options(gremlin_lang):
+        options_strategy = next((x for x in gremlin_lang.options_strategies), 
None)
         request_options = None
         if options_strategy:
-            allowed_keys = ['evaluationTimeout', 'scriptEvaluationTimeout', 
'batchSize', 'requestId', 'userAgent',
-                            'materializeProperties']
-            request_options = {allowed: 
options_strategy[1].configuration[allowed] for allowed in allowed_keys
-                               if allowed in options_strategy[1].configuration}
+            request_options = {token: options_strategy.configuration[token] 
for token in TokensV4
+                               if token in options_strategy.configuration}
+        if gremlin_lang.parameters is not None and 
len(gremlin_lang.parameters) > 0:
+            if request_options is None:
+                request_options = gremlin_lang.parameters

Review Comment:
   good to have test coverage



-- 
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