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

Vedant Roy updated ARROW-17957:
-------------------------------
    Description: 
The following code doesn't work:
{code:java}
f.download("some_path") {code}
   where `f` is a `pyarrow.NativeFile`.

I get the error:

```

(_execute_read_task pid=126666)     f.download(temp_file)
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 576, in 
pyarrow.lib.NativeFile.download
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 291, in 
pyarrow.lib.NativeFile.seek
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 190, in 
pyarrow.lib.NativeFile.get_random_access_file
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 219, in 
pyarrow.lib.NativeFile._assert_seekable
(_execute_read_task pid=126666) OSError: only valid on seekable files

```

 

 

  was:
The following code doesn't work:
{code:java}
       with tempfile.TemporaryFile() as temp_file:
                f.download(temp_file) {code}
   where `f` is a `pyarrow.NativeFile`.

I get the error:

```

(_execute_read_task pid=126666)     f.download(temp_file)
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 576, in 
pyarrow.lib.NativeFile.download
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 291, in 
pyarrow.lib.NativeFile.seek
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 190, in 
pyarrow.lib.NativeFile.get_random_access_file
(_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 219, in 
pyarrow.lib.NativeFile._assert_seekable
(_execute_read_task pid=126666) OSError: only valid on seekable files

```

 

 

        Summary: NativeFile.download throws seekable error  (was: 
NativeFile.download does not work on TemporaryFiles)

> NativeFile.download throws seekable error
> -----------------------------------------
>
>                 Key: ARROW-17957
>                 URL: https://issues.apache.org/jira/browse/ARROW-17957
>             Project: Apache Arrow
>          Issue Type: Bug
>         Environment: Ubuntu
>            Reporter: Vedant Roy
>            Priority: Minor
>
> The following code doesn't work:
> {code:java}
> f.download("some_path") {code}
>    where `f` is a `pyarrow.NativeFile`.
> I get the error:
> ```
> (_execute_read_task pid=126666)     f.download(temp_file)
> (_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 576, in 
> pyarrow.lib.NativeFile.download
> (_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 291, in 
> pyarrow.lib.NativeFile.seek
> (_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 190, in 
> pyarrow.lib.NativeFile.get_random_access_file
> (_execute_read_task pid=126666)   File "pyarrow/io.pxi", line 219, in 
> pyarrow.lib.NativeFile._assert_seekable
> (_execute_read_task pid=126666) OSError: only valid on seekable files
> ```
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to