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

[Python] read_tensor() fails on non-seekable streams

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.13.0
    • Fix Version/s: 0.15.0
    • Component/s: Python
    • Labels:
      None
    • Environment:
      pyarrow installed via pip, pyarrow==0.13.0

      Description

      when reading a tensor from from a compressed pyarrow stream, it fails with

      Traceback (most recent call last):
       File "test.py", line 10, in <module>
       tensor = pa.read_tensor(in_stream)
       File "pyarrow/ipc.pxi", line 470, in pyarrow.lib.read_tensor
       File "pyarrow/io.pxi", line 153, in pyarrow.lib.NativeFile.get_random_access_file
       File "pyarrow/io.pxi", line 182, in pyarrow.lib.NativeFile._assert_seekable
      OSError: only valid on seekable files

      example code:

      import pyarrow as pa
      import numpy as np
      
      a = np.random.random(size = (100,110,3) )
      
      out_stream = pa.output_stream('test.pa', compression='gzip', buffer_size=None)
      pa.write_tensor(pa.Tensor.from_numpy(a), out_stream)
      
      in_stream = pa.input_stream('test.pa', compression='gzip', buffer_size=None)
      tensor = pa.read_tensor(in_stream)
      b = pa.Tensor.to_numpy(tensor)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kkrispin Karsten Krispin
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: