# Buggy code
def put(self, session_id, chunk_key, value):
    """
    Put a Mars object into plasma store
    :param session_id: session id
    :param chunk_key: chunk key
    :param value: Mars object to be put
    """
    import pyarrow
    from pyarrow.lib import PlasmaStoreFull
    from ..serialize.dataserializer import DataTuple

    data_size = calc_data_size(value)
    if isinstance(value, tuple):
        value = DataTuple(*value)

    try:
        obj_id = self._new_object_id(session_id, chunk_key)
    except StoreKeyExists:
        obj_id = self._get_object_id(session_id, chunk_key)
        if self._plasma_client.contains(obj_id):
            logger.debug("Chunk %s already exists, returning existing", chunk_key)
            [buffer] = self._plasma_client.get_buffers([obj_id], timeout_ms=10)
            return buffer
        else:
            logger.warning(
                "Chunk %s registered but no data found, reconstructed", chunk_key
            )
            self.delete(session_id, chunk_key)
            obj_id = self._new_object_id(session_id, chunk_key)

    try:
        serialized = pyarrow.serialize(value, self._serialize_context)
        try:
            buffer = self._plasma_client.create(obj_id, serialized.total_bytes)
            stream = pyarrow.FixedSizeBufferWriter(buffer)
            stream.set_memcopy_threads(6)
            serialized.write_to(stream)
            self._plasma_client.seal(obj_id)
        finally:
            del serialized
        return buffer
    except PlasmaStoreFull:
        self._mapper_ref.delete(session_id, chunk_key)
        logger.warning(
            "Chunk %s(%d) failed to store to plasma due to StoreFullError",
            chunk_key,
            data_size,
        )
        exc = PlasmaStoreFull

    if exc is PlasmaStoreFull:
        raise StoreFull


# Traceback (TypeError)
Traceback (most recent call last):
File "/home/admin/work/_public-mars-0.1.1.zip/mars/scheduler/operand.py", line 461, in _rejecter
six.reraise(*exc)
File "/home/admin/work/_public-mars-0.1.1.zip/mars/lib/six.py", line 702, in reraise
raise value.with_traceback(tb)
File "/home/admin/work/_public-mars-0.1.1.zip/mars/promise.py", line 92, in _wrapped
result = func(*args, **kwargs)
File "/home/admin/work/_public-mars-0.1.1.zip/mars/utils.py", line 288, in _wrapped
return func(*args, **kwargs)
File "/home/admin/work/_public-mars-0.1.1.zip/mars/worker/calc.py", line 72, in _try_put_chunk
ref = self._chunk_store.put(session_id, chunk_key, _calc_result_cache[chunk_key][1])
File "/home/admin/work/_public-mars-0.1.1.zip/mars/worker/chunkstore.py", line 184, in put
value = DataTuple(*value)
TypeError: tuple() takes at most 1 argument (2 given)

# Fixed code
def put(self, session_id, chunk_key, value):
    """
    Put a Mars object into plasma store
    :param session_id: session id
    :param chunk_key: chunk key
    :param value: Mars object to be put
    """
    import pyarrow
    from pyarrow.lib import PlasmaStoreFull

    data_size = calc_data_size(value)

    try:
        obj_id = self._new_object_id(session_id, chunk_key)
    except StoreKeyExists:
        obj_id = self._get_object_id(session_id, chunk_key)
        if self._plasma_client.contains(obj_id):
            logger.debug("Chunk %s already exists, returning existing", chunk_key)
            [buffer] = self._plasma_client.get_buffers([obj_id], timeout_ms=10)
            return buffer
        else:
            logger.warning(
                "Chunk %s registered but no data found, reconstructed", chunk_key
            )
            self.delete(session_id, chunk_key)
            obj_id = self._new_object_id(session_id, chunk_key)

    try:
        serialized = pyarrow.serialize(value, self._serialize_context)
        try:
            buffer = self._plasma_client.create(obj_id, serialized.total_bytes)
            stream = pyarrow.FixedSizeBufferWriter(buffer)
            stream.set_memcopy_threads(6)
            serialized.write_to(stream)
            self._plasma_client.seal(obj_id)
        finally:
            del serialized
        return buffer
    except PlasmaStoreFull:
        self._mapper_ref.delete(session_id, chunk_key)
        logger.warning(
            "Chunk %s(%d) failed to store to plasma due to StoreFullError",
            chunk_key,
            data_size,
        )
        exc = PlasmaStoreFull
    except:  # noqa: E722  # pragma: no cover
        self._mapper_ref.delete(session_id, chunk_key)
        raise

    if exc is PlasmaStoreFull:
        raise StoreFull