tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
101 stars 46 forks source link

call/call16: Connection.call method should work on both 1.6 and 1.7 #97

Closed bofm closed 2 years ago

bofm commented 6 years ago

Python 3.5 tarantool==0.6.1 (from PyPI)

>>> connection = tarantool.connect(host = 'tarantool-1.7.5', port=3301)
>>> connection.call("box.info")

>>> connection = tarantool.connect(host = 'tarantool-1.6.9', port=3301)
>>> connection.call("box.info")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/tarantool/connection.py", line 373, in call
    response = self._send_request(request)
  File "/usr/local/lib/python3.5/dist-packages/tarantool/connection.py", line 341, in _send_request
    return self._send_request_wo_reconnect(request)
  File "/usr/local/lib/python3.5/dist-packages/tarantool/connection.py", line 261, in _send_request_wo_reconnect
    response = Response(self, self._read_response())
  File "/usr/local/lib/python3.5/dist-packages/tarantool/response.py", line 87, in __init__
    raise DatabaseError(self._return_code, self._return_message)
tarantool.error.DatabaseError: (48, 'Unknown request type 10')
>>> 

The driver must automatically check Tarantool version. The call method must work on both 1.6 and 1.7.

Totktonada commented 2 years ago

I don't think that automatic change of the response shape is the good idea.

I also doubt that it is important now, when 1.6 becomes ancient.