Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
0.17.0
Description
The documentation for Plasma in Python at https://arrow.apache.org/docs/python/plasma.html produces several FutureWarning messages for pyarrow.get_tensor_size, pyarrow.read_tensor and pyarrow.write_tensor
In [9]: import numpy as np
: import pyarrow as pa
:
: # Create a pyarrow.Tensor object from a numpy random 2-dimensional array
: data = np.random.randn(10, 4)
: tensor = pa.Tensor.from_numpy(data)
:
: # Create the object in Plasma
: object_id = plasma.ObjectID(np.random.bytes(20))
: data_size = pa.get_tensor_size(tensor)
: buf = client.create(object_id, data_size)
/usr/local/lib/python3.8/site-packages/pyarrow/util.py:39: FutureWarning: pyarrow.get_tensor_size is deprecated as of 0.17.0, please use pyarrow.ipc.get_tensor_size instead
warnings.warn(msg, FutureWarning)
In [10]: # Write the tensor into the Plasma-allocated buffer
: stream = pa.FixedSizeBufferWriter(buf)
: pa.write_tensor(tensor, stream) # Writes tensor's 552 bytes to Plasma stream
/usr/local/lib/python3.8/site-packages/pyarrow/util.py:39: FutureWarning: pyarrow.write_tensor is deprecated as of 0.17.0, please use pyarrow.ipc.write_tensor instead
warnings.warn(msg, FutureWarning)
In [13]: # Reconstruct the Arrow tensor object.
: reader = pa.BufferReader(buf2)
: tensor2 = pa.read_tensor(reader)
/usr/local/lib/python3.8/site-packages/pyarrow/util.py:39: FutureWarning: pyarrow.read_tensor is deprecated as of 0.17.0, please use pyarrow.ipc.read_tensor instead
warnings.warn(msg, FutureWarning)
Attachments
Issue Links
- links to