You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Joris Van den Bossche (JIRA)" <ji...@apache.org> on 2019/07/11 12:43:00 UTC
[jira] [Updated] (ARROW-5910) [Python] read_tensor() fails on
non-seekable streams
[ https://issues.apache.org/jira/browse/ARROW-5910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joris Van den Bossche updated ARROW-5910:
-----------------------------------------
Summary: [Python] read_tensor() fails on non-seekable streams (was: read_tensor() fails on non-seekable streams)
> [Python] read_tensor() fails on non-seekable streams
> ----------------------------------------------------
>
> Key: ARROW-5910
> URL: https://issues.apache.org/jira/browse/ARROW-5910
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 0.13.0
> Environment: pyarrow installed via pip, pyarrow==0.13.0
> Reporter: Karsten Krispin
> Priority: Major
>
> when reading a tensor from from a compressed pyarrow stream, it fails with
> {code:java}
> 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{code}
> example code:
> {code:java}
> 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){code}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)