tarantool / tarantool-python

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

AttributeError: 'module' object has no attribute 'NUM' #149

Closed ToPP13 closed 2 years ago

ToPP13 commented 5 years ago

pip install tarantool-python>0.4

python 2.7.12

import tarantool tarantool.STR Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'STR'

import tarantool tarantool.NUM Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'NUM'

tarantool.version '0.6.6'

tarantool.dict.keys() ['utils', 'path', 'connect', 'ENCODING_DEFAULT', 'Schema', 'const', 'all', 'space', 'MeshConnection', 'package', 'RECONNECT_MAX_ATTEMPTS', 'doc', 'schema', 'builtins', 'file', 'NetworkError', 'Connection', 'Error', 'name', 'RECONNECT_DELAY', 'response', 'NetworkWarning', 'version', 'SOCKET_TIMEOUT', 'request', 'connectmesh', 'mesh_connection', 'connection', 'error', 'SchemaError', 'DatabaseError']

Totktonada commented 3 years ago

Sorry for the long delay! As I see, those contants were removed more than six years ago in 0f9d99ecb770586ca011800a6e3921c3353c7459:

-# Tarantool data types
-RAW = 0
-NUM = 1
-NUM64 = 2
-STR = 3

I looked briefly at the old code and I guess that those constants were used to define a database schema on a client side, because ancient tarantool versions do not support defining a database schema on the server side. Now one can define a space format on the server and the client will automatically fetch and interpret the schema to perform requests using space/index/field names.

Please, share more details about your usage scenario: maybe we can suggest how to better solve your problem.

Totktonada commented 2 years ago

Since there is no response for several months, I guess the problem is resolved or not actual anymore. Closing so.