You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
There seem to be few C++ Exceptions leaking from the pyarrow implementation of the pyarrow.fs.AzureFileSystem.
One example is the Azure::core::Http::TransportException: Timeout waiting for socket to read coming from the Azure C++ SDK.
Another example is that if user provides the AzureFileSystem class constructor with account_key which is not a valid base64 encoded string, this exception is raised and kills the process: libc++abi: terminating due to uncaught exception of type std::runtime_error: Unexpected character in Base64 encoded string
Would it be please possible to catch the C++ Exceptions such as the TransportException and raise them as Python exception of some kind?
It would enable the users to decide how to handle such issues instead of failing/crashing the user application.
To reproduce
example 1:
>>>importpyarrow.fs>>>fs=pyarrow.fs.AzureFileSystem(account_name="doesntexist", account_key="bl==")
>>>fs.create_dir("bla/bla")
libc++abi: terminatingduetouncaughtexceptionof type Azure::Core::Http::TransportException: Failtogetanewconnectionfor: https://doesnt_exist.dfs.core.windows.net. Couldn'tresolvehostname
example 2:
>>>importpyarrow.fs>>>fs=pyarrow.fs.AzureFileSystem(account_name="doesntexist", account_key="bla")
>>>fs.create_dir("bla/bla")
libc++abi: terminatingduetouncaughtexceptionof type std::runtime_error: UnexpectedcharacterinBase64encodedstring
Versions
Python version: 3.12.2
PyArrow version: 17.0.0
Component(s)
Python
The text was updated successfully, but these errors were encountered:
Tjev
changed the title
[Python][FS][Azure] C++ TransportException leaking from pyarrow
[Python][FS][Azure] C++ Exceptions leaking from PyArrow
Sep 30, 2024
kou
added a commit
to kou/arrow
that referenced
this issue
Oct 1, 2024
…ort check
`Azure::Storage::Files::DataLake::DataLakeDirectoryClient` may throw
`Azure::Core::Http::TransportException` and `std::runtime_error`
exceptions but they aren't caught. Arrow C++ uses `arrow::Status` not
C++ exception. So we must catch all exceptions from Azure SDK for C++.
…eck (#44274)
### Rationale for this change
`Azure::Storage::Files::DataLake::DataLakeDirectoryClient` may throw `Azure::Core::Http::TransportException` and `std::runtime_error` exceptions but they aren't caught. Arrow C++ uses `arrow::Status` not C++ exception. So we must catch all exceptions from Azure SDK for C++.
### What changes are included in this PR?
Add catches `Azure::Core::Http::TransportException` and `std::exception`.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
* GitHub Issue: #44269
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Describe the bug, including details regarding any error messages, version, and platform.
There seem to be few C++ Exceptions leaking from the pyarrow implementation of the
pyarrow.fs.AzureFileSystem
.One example is the
Azure::core::Http::TransportException: Timeout waiting for socket to read
coming from the Azure C++ SDK.Another example is that if user provides the AzureFileSystem class constructor with account_key which is not a valid base64 encoded string, this exception is raised and kills the process:
libc++abi: terminating due to uncaught exception of type std::runtime_error: Unexpected character in Base64 encoded string
Would it be please possible to catch the C++ Exceptions such as the TransportException and raise them as Python exception of some kind?
It would enable the users to decide how to handle such issues instead of failing/crashing the user application.
To reproduce
example 1:
example 2:
Versions
Python version: 3.12.2
PyArrow version: 17.0.0
Component(s)
Python
The text was updated successfully, but these errors were encountered: