Skip to content

Commit 44c3b3d

Browse files
committed
fixes
1 parent 20b119e commit 44c3b3d

4 files changed

Lines changed: 16 additions & 19 deletions

File tree

python/pyarrow/lib.pxd

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ cdef class NativeFile:
330330
cdef get_reader(object source, shared_ptr[RandomAccessFile]* reader)
331331
cdef get_writer(object source, shared_ptr[OutputStream]* writer)
332332

333-
cdef class SerializedPyObject:
334-
cdef:
335-
CSerializedPyObject data
336-
337-
cdef readonly:
338-
object base
339-
340-
cdef _write_to(self, OutputStream* stream)
341-
342333
cdef public object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf)
343334
cdef public object pyarrow_wrap_data_type(const shared_ptr[CDataType]& type)
344335
cdef public object pyarrow_wrap_field(const shared_ptr[CField]& field)

python/pyarrow/plasma.pyx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from cpython.pycapsule cimport *
2929
import collections
3030
import pyarrow
3131

32-
from pyarrow.lib cimport Buffer, NativeFile, check_status, SerializedPyObject
32+
from pyarrow.lib cimport Buffer, NativeFile, check_status
3333
from pyarrow.includes.libarrow cimport (CMutableBuffer, CBuffer,
3434
CFixedSizeBufferWriter, CStatus)
3535

@@ -616,7 +616,7 @@ def put(PlasmaClient client, value, object_id=None):
616616
client : PlasmaClient
617617
The client connected to the object store we put the value in.
618618
value : object
619-
A Python object to store.
619+
A Python object to store. Currently only lists are supported.
620620
object_id : ObjectID, default None
621621
If this is provided, the specified object ID will be used to refer
622622
to the object.
@@ -626,7 +626,7 @@ def put(PlasmaClient client, value, object_id=None):
626626
The object ID associated to the Python object.
627627
"""
628628
cdef ObjectID id = object_id if object_id else ObjectID.from_random()
629-
cdef SerializedPyObject serialized = pyarrow.serialize(value)
629+
serialized = pyarrow.serialize(value)
630630
buffer = client.create(id, serialized.total_bytes)
631631
stream = pyarrow.FixedSizeBufferOutputStream(buffer)
632632
stream.set_memcopy_threads(4)
@@ -642,18 +642,19 @@ def get(PlasmaClient client, object_ids, timeout_ms=-1):
642642
----------
643643
client : PlasmaClient
644644
The client connected to the object store we get objects from.
645-
object_ids : list
646-
The list of object IDs associated to the values we get from the store.
645+
object_ids : list or ObjectID
646+
Object ID or list of object IDs associated to the values we get from
647+
the store.
647648
timeout_ms : int, default -1
648649
The number of milliseconds that the get call should block before
649650
timing out and returning. Pass -1 if the call should block and 0
650651
if the call should return immediately.
651652
652653
Returns
653654
-------
654-
list
655-
List of Python values for the data associated with the object_ids
656-
and ObjectNotAvailable if the object was not available.
655+
list or object
656+
Python value or list of Python values for the data associated with
657+
the object_ids and ObjectNotAvailable if the object was not available.
657658
"""
658659
if isinstance(object_ids, collections.Sequence):
659660
results = []

python/pyarrow/serialization.pxi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ cdef class SerializedPyObject:
135135
"""
136136
Arrow-serialized representation of Python object
137137
"""
138+
cdef:
139+
CSerializedPyObject data
140+
141+
cdef readonly:
142+
object base
138143

139144
property total_bytes:
140145

python/pyarrow/tests/test_plasma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def start_plasma_store(plasma_store_memory=DEFAULT_PLASMA_STORE_MEMORY,
119119
"""
120120
if use_valgrind and use_profiler:
121121
raise Exception("Cannot use valgrind and profiler at the same time.")
122-
plasma_store_executable = "plasma_store"
122+
plasma_store_executable = os.path.join(pa.__path__[0], "plasma_store")
123123
plasma_store_name = "/tmp/plasma_store{}".format(random_name())
124124
command = [plasma_store_executable,
125125
"-s", plasma_store_name,
@@ -282,7 +282,7 @@ def test_put_and_get(self):
282282
result = pa.plasma.get(self.plasma_client, object_id)
283283
assert result == value
284284

285-
object_id = pa.plasma.ObjectID(np.bytes.random(20))
285+
object_id = pa.plasma.ObjectID.from_random()
286286
[result] = pa.plasma.get(self.plasma_client, [object_id], timeout_ms=0)
287287
assert result == pa.plasma.ObjectNotAvailable
288288

0 commit comments

Comments
 (0)