tarantool / tarantool-python

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

call parameters bug in 0.5.* #81

Closed antipetrov closed 7 years ago

antipetrov commented 8 years ago

Tarantool==1.6.7-593 tarantool-python==0.5.4

I'm trying to call box.space.auth_user:auto_increment{"8", 7, 7, 7} from python script. This is what I do in python

import tarantool
connection = tarantool.connect('127.0.0.1', 3303)
connection.call('box.space.auth_user:auto_increment', ("8", 7, 7, 7))

And then I get the error:

[string "-- schema.lua (internal file)..."]:921: bad argument #1 to 'insert' (table expected, got string)

This is how I define my auth_user schema

box.schema.space.create('auth_user',{if_not_exists=true})
box.space.auth_user:create_index('primary', {type='TREE', if_not_exists=true, unique=true, parts={1,'NUM'}})
box.space.auth_user:create_index('login', {type='HASH', if_not_exists=true, unique=true, parts={2,'STR'}})

Am I calling it wrong?

bigbes commented 7 years ago

Sorry for waiting. It should be called like this:

connection.call('box.space.auth_user:auto_increment', (("8", 7, 7, 7),))