jorisvandenbossche commented on issue #41365:
URL: https://github.com/apache/arrow/issues/41365#issuecomment-2331306145
So going through the logic in the `_resolve_filesystem_and_path` helper
function, I think the main reason we catch (and swallow) the error from
`FileSystem.from_uri` is because we wanted to provide a better error message
for local file paths that were not found.
However, in that case you typically get an error about an empty scheme, and
not a "Cannot parse URI" error. For example:
```
In [1]: import pyarrow.fs
In [2]: pyarrow.fs.FileSystem.from_uri("local/file/path")
...
ArrowInvalid: URI has empty scheme: 'local/file/path'
/arrow/cpp/src/arrow/filesystem/filesystem.cc:937
ParseFileSystemUri(uri_string)
```
Essentially, if an error happens and if the user provides a URI we want to
show the error that happens when parsing the URI, and it the user passes a
local file path, we would like to show the error that happens when we assume it
is a local file path (and further down the line this will then give a file not
found error).
But couldn't we use some basic heuristic to determine if the user is
actually passing a URI? (I don't know how robust it is to check if `://` in the
string?)
Based on the above example, it might also to only catch the "empty scheme"
error and let the "Cannot parse URI" error always bubble up to the user.
--
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]