thisisnic commented on code in PR #14030:
URL: https://github.com/apache/arrow/pull/14030#discussion_r982556651
##########
r/R/util.R:
##########
@@ -134,12 +134,7 @@ read_compressed_error <- function(e) {
stop(e)
}
-# This function was refactored in ARROW-15260 to only raise an error if
-# the appropriate string was found and so errors must be raised manually after
-# calling this if matching error not found
-# TODO: Refactor as part of ARROW-17355 to prevent potential missed errors
-handle_parquet_io_error <- function(e, format, call) {
- msg <- conditionMessage(e)
+handle_parquet_io_error <- function(msg, call, format) {
Review Comment:
OK, I've tried it out both ways, and see what `parent = e` does, but I think
it makes more sense the way it prints currently. What do you think?
The way it looks now:
```
Error in `open_dataset()`:
! Invalid: Error creating dataset. Could not read schema from 'file1.csv':
Could not open Parquet input source
'/tmp/RtmpLed3En/filebe14261f95ab2/5/file1.csv': Parquet magic bytes not found
in footer. Either the file is corrupted or this is not a parquet file.
/home/nic2/arrow/cpp/src/arrow/dataset/file_parquet.cc:338
GetReader(source, scan_options). Is this a 'parquet' file?
/home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:40
InspectSchemas(std::move(options))
/home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:262
Inspect(options.inspect_options)
ℹ Did you mean to specify a 'format' other than the default (parquet)?
```
With `parent = e`:
```
Error in `open_dataset()`:
! ℹ Did you mean to specify a 'format' other than the default (parquet)?
Caused by error:
! Invalid: Error creating dataset. Could not read schema from 'file1.csv':
Could not open Parquet input source
'/tmp/RtmpLed3En/filebe14261f95ab2/5/file1.csv': Parquet magic bytes not found
in footer. Either the file is corrupted or this is not a parquet file.
/home/nic2/arrow/cpp/src/arrow/dataset/file_parquet.cc:338
GetReader(source, scan_options). Is this a 'parquet' file?
/home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:40
InspectSchemas(std::move(options))
/home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:262
Inspect(options.inspect_options)
Run `rlang::last_error()` to see where the error occurred.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]