You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Francois Saint-Jacques (Jira)" <ji...@apache.org> on 2020/05/19 01:33:00 UTC

[jira] [Resolved] (ARROW-8851) [Python][Documentation] Fix FutureWarnings in Python Plasma docs

     [ https://issues.apache.org/jira/browse/ARROW-8851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Saint-Jacques resolved ARROW-8851.
-------------------------------------------
    Fix Version/s: 1.0.0
       Resolution: Fixed

Issue resolved by pull request 7217
[https://github.com/apache/arrow/pull/7217]

> [Python][Documentation] Fix FutureWarnings in Python Plasma docs
> ----------------------------------------------------------------
>
>                 Key: ARROW-8851
>                 URL: https://issues.apache.org/jira/browse/ARROW-8851
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Documentation, Python
>    Affects Versions: 0.17.0
>            Reporter: Weston Steimel
>            Assignee: Weston Steimel
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.0.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)