Skip to content

Commit e594774

Browse files
committed
Fix conn.update() broken by c6df537
1 parent 94b7b39 commit e594774

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/tarantool/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def update(self, space_name, key, op_list, return_tuple=False):
273273
'''
274274
assert isinstance(key, (int, basestring))
275275

276-
request = RequestUpdate(space_name, key, op_list, return_tuple)
276+
request = RequestUpdate(self, space_name, key, op_list, return_tuple)
277277
return self._send_request(request, space_name)
278278

279279

src/tarantool/request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ def __init__(self, conn, space_name, key, op_list, return_tuple): # pylint: d
247247

248248
self._bytes = self.header(len(request_body)) + request_body
249249

250-
@classmethod
251-
def pack_operations(cls, op_list):
250+
def pack_operations(self, op_list):
252251
result = []
253252
for op in op_list:
254253
try:
@@ -260,7 +259,8 @@ def pack_operations(cls, op_list):
260259
except KeyError:
261260
raise ValueError("Invalid operaction symbol '%s', expected one of %s"\
262261
%(op_symbol, ', '.join(["'%s'"%c for c in sorted(UPDATE_OPERATION_CODE.keys())])))
263-
data = b"".join([struct_LB.pack(field_no, op_code), cls.pack_field(op_arg)])
262+
op_arg = self.conn.schema.pack_value(op_arg)
263+
data = b"".join([struct_LB.pack(field_no, op_code), self.pack_field(op_arg)])
264264
result.append(data)
265265
return b"".join(result)
266266

0 commit comments

Comments
 (0)