@@ -370,14 +370,14 @@ cdef class PlasmaClient:
370370 object_buffers[i].metadata_size))
371371 return result
372372
373- def put (self , list value , ObjectID object_id = None ):
373+ def put (self , object value , ObjectID object_id = None ):
374374 """
375375 Store a Python value into the object store.
376376
377377 Parameters
378378 ----------
379- value : list
380- A Python object to store. Currently only lists are supported.
379+ value : object
380+ A Python object to store.
381381 object_id : ObjectID, default None
382382 If this is provided, the specified object ID will be used to refer
383383 to the object.
@@ -387,7 +387,9 @@ cdef class PlasmaClient:
387387 The object ID associated to the Python object.
388388 """
389389 cdef ObjectID target_id = object_id if object_id else ObjectID.from_random()
390- serialized = pyarrow.serialize(value)
390+ # TODO(pcm): Make serialization code support non-sequences and
391+ # get rid of packing the value into a list here (and unpacking in get)
392+ serialized = pyarrow.serialize([value])
391393 buffer = self .create(target_id, serialized.total_bytes)
392394 stream = pyarrow.FixedSizeBufferOutputStream(buffer )
393395 stream.set_memcopy_threads(4 )
@@ -422,7 +424,8 @@ cdef class PlasmaClient:
422424 # buffers[i] is None if this object was not available within the
423425 # timeout
424426 if buffers[i]:
425- results.append(pyarrow.deserialize(buffers[i]))
427+ value, = pyarrow.deserialize(buffers[i])
428+ results.append(value)
426429 else :
427430 results.append(ObjectNotAvailable)
428431 return results
0 commit comments