Cole-Greer commented on code in PR #2702:
URL: https://github.com/apache/tinkerpop/pull/2702#discussion_r1702267424
##########
gremlin-python/src/main/python/gremlin_python/driver/client.py:
##########
@@ -154,20 +155,19 @@ def submit_async(self, message, bindings=None,
request_options=None):
log.debug("message '%s'", str(message))
fields = {'g': self._traversal_source}
- if isinstance(message, traversal.Bytecode):
- fields['gremlinType'] = 'bytecode'
- elif isinstance(message, str):
- fields['gremlinType'] = 'eval'
if isinstance(message, str) and bindings:
fields['bindings'] = bindings
- if isinstance(message, traversal.Bytecode) or isinstance(message, str):
+ if isinstance(message, str):
log.debug("fields='%s', gremlin='%s'", str(fields), str(message))
message = request.RequestMessageV4(fields=fields, gremlin=message)
conn = self._pool.get(True)
if request_options:
- message.fields.update(request_options)
+ message.fields.update({token: request_options[token] for token in
TokensV4
+ if token in request_options})
+ if 'params' in request_options:
Review Comment:
Is there a distinction between `bindings` and `request_options['params']`?
Do we need to have both or can we simplify this interface a bit?
If we do keep both, would it be better to merge both dicts together instead
of taking either `bindings` and `request_options['params']`?
--
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]