apache / apache/arrow

[C++] Improve error message when reading Streaming file with File reader and vice versa

Open
#33,823 12 comments 0 reactions 1 assignee Claimed by @RobertLD View on GitHub
Component: C++ Component: Python good-first-issue Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

### Describe the bug, including details regarding any error messages, version, and platform.

I am trying to loan an arrow file

```python
with pa.memory_map('flights-200k.arrow', 'r') as source:
my_arrow = pa.ipc.open_file(source).read_all()
```

but get this error

```
File "/opt/homebrew/Caskroom/miniforge/base/envs/ramsch/lib/python3.10/site-packages/pyarrow/ipc.py", line 228, in open_file
return RecordBatchFileReader(
File "/opt/homebrew/Caskroom/miniforge/base/envs/ramsch/lib/python3.10/site-packages/pyarrow/ipc.py", line 110, in __init__
self._open(source, footer_offset=footer_offset,
File "pyarrow/ipc.pxi", line 862, in pyarrow.lib._RecordBatchFileReader._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Not an Arrow file
```

The arrow file is https://github.com/uwdata/flights-arrow/blob/master/flights-200k.arrow and loads fine in the arrow js library.

### Component(s)

Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.