-
Notifications
You must be signed in to change notification settings - Fork 4.1k
GH-33823: [C++] Improve err msgs when opening files that are the wrong format #49771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1890,7 +1890,9 @@ class RecordBatchFileReaderImpl : public RecordBatchFileReader { | |||||||||
| const auto magic_start = buffer->data() + sizeof(int32_t); | ||||||||||
| if (std::string_view(reinterpret_cast<const char*>(magic_start), kMagicSize) != | ||||||||||
| kArrowMagicBytes) { | ||||||||||
| return Status::Invalid("Not an Arrow file"); | ||||||||||
| return Status::Invalid( | ||||||||||
| "Not an Arrow file. If this is an Arrow IPC Streaming format file, try " | ||||||||||
| "open_stream() instead."); | ||||||||||
|
Comment on lines
+1894
to
+1895
|
||||||||||
| "Not an Arrow file. If this is an Arrow IPC Streaming format file, try " | |
| "open_stream() instead."); | |
| "Not an Arrow file. If this is an Arrow IPC streaming format file, use " | |
| "the IPC stream reader instead."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error text is emitted from the C++ IPC decoder but recommends
open_file()/open_stream(), which are binding-specific names (they don't exist in the C++ API). Consider API-neutral guidance (IPC file reader vs IPC stream reader) or include the C++ entry points (e.g.,RecordBatchFileReader::Open/RecordBatchStreamReader::Open). Also, "Arrow IPC File format file" repeats "file"; reword to avoid the redundancy.