Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8851

[Python][Documentation] Fix FutureWarnings in Python Plasma docs

Details

    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

          Activity

            People

              westonsteimel Weston Steimel
              westonsteimel Weston Steimel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Slack

                    Issue deployment