You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2019/09/09 14:39:00 UTC

[jira] [Resolved] (ARROW-5374) [Python] Misleading error message when calling pyarrow.read_record_batch on a complete IPC stream

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

Antoine Pitrou resolved ARROW-5374.
-----------------------------------
    Resolution: Fixed

Issue resolved by pull request 5313
[https://github.com/apache/arrow/pull/5313]

> [Python] Misleading error message when calling pyarrow.read_record_batch on a complete IPC stream
> -------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-5374
>                 URL: https://issues.apache.org/jira/browse/ARROW-5374
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Antoine Pitrou
>            Assignee: Wes McKinney
>            Priority: Major
>              Labels: beginner, pull-request-available
>             Fix For: 0.15.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:python}
> >>> batch = pa.RecordBatch.from_arrays([pa.array([b"foo"], type=pa.utf8())], names=['strs'])                                                                   
> >>> stream = pa.BufferOutputStream()
> >>> writer = pa.RecordBatchStreamWriter(stream, batch.schema)
> >>> writer.write_batch(batch)                                                                                                                                  
> >>> writer.close()                                                                                                                                             
> >>> buf = stream.getvalue()                                                                                                                                    
> >>> pa.read_record_batch(buf, batch.schema)                                                                                                                    
> Traceback (most recent call last):
>   File "<ipython-input-31-4f168f453f3a>", line 1, in <module>
>     pa.read_record_batch(buf, batch.schema)
>   File "pyarrow/ipc.pxi", line 583, in pyarrow.lib.read_record_batch
>     check_status(ReadRecordBatch(deref(message.message.get()),
>   File "pyarrow/error.pxi", line 87, in pyarrow.lib.check_status
>     raise ArrowIOError(message)
> ArrowIOError: Expected IPC message of type schema got record batch
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)