You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Diana Clarke (Jira)" <ji...@apache.org> on 2021/03/17 12:26:00 UTC

[jira] [Comment Edited] (ARROW-11939) Bug in `pa.PythonFile`?

    [ https://issues.apache.org/jira/browse/ARROW-11939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17303345#comment-17303345 ] 

Diana Clarke edited comment on ARROW-11939 at 3/17/21, 12:25 PM:
-----------------------------------------------------------------

{{PythonFile}} is expecting a file object, not a path to a file.

[https://arrow.apache.org/docs/python/generated/pyarrow.PythonFile.html]

For example:
{code:java}
import pyarrow
import pyarrow.parquet

with open("foo.parquet", "rb") as f:
    table = pyarrow.parquet.read_table(pyarrow.PythonFile(f))
{code}



was (Author: dianaclarke):
{{PythonFile}} is expecting a file object, not a path to a file.

https://arrow.apache.org/docs/python/generated/pyarrow.PythonFile.html

For example:

{code}
import pyarrow

with open("foo.parquet", "rb") as f:
    pyarrow.PythonFile(f)
{code}

> Bug in `pa.PythonFile`?
> -----------------------
>
>                 Key: ARROW-11939
>                 URL: https://issues.apache.org/jira/browse/ARROW-11939
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>    Affects Versions: 3.0.0
>            Reporter: Dave Hirschfeld
>            Priority: Major
>
> ```python
> with pa.PythonFile('deleteme.jnk', 'wb') as f: pass
> AttributeError: 'str' object has no attribute 'closed'
> ```



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