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.
Refactor Substrait.run_query() in C++/PyArrow so that it does not suppress user-defined Exceptions.
In PyArrow, Substrait can take in a table_provider object, which can map a table name in the Substrait plan to a table object in memory. This table_provider is user-defined python code, which can throw an exception. The underlying C++ implementation currently suppresses user-defined expressions and will instead report a more generic error[1]:
When upgrading to Cython 3, the user-defined exception is now raised by default because cdef functions that are not extern now safely propagate Python exceptions by default. To mask raising this exception, we have to explicitly add noexcept to this Cython function[2]:
To mask raising this exception, we have to explicitly add noexcept to this Cython function[2]:
The proper solution would be for the Cython function to return CResult[CDeclaration]. This might need a bit of plumbing on the C++ side. Do you think you can give it a try?
Describe the bug, including details regarding any error messages, version, and platform.
Refactor Substrait.run_query() in C++/PyArrow so that it does not suppress user-defined Exceptions.
In PyArrow, Substrait can take in a
table_provider
object, which can map a table name in the Substrait plan to a table object in memory. Thistable_provider
is user-defined python code, which can throw an exception. The underlying C++ implementation currently suppresses user-defined expressions and will instead report a more generic error[1]:When upgrading to Cython 3, the user-defined exception is now raised by default because cdef functions that are not extern now safely propagate Python exceptions by default. To mask raising this exception, we have to explicitly add
noexcept
to this Cython function[2]:This is the pytest output seen when suppressing the python user-defined Exception:
[1] https://github.com/apache/arrow/blob/main/cpp/src/arrow/engine/substrait/relation_internal.cc#L422-L427
[2] https://github.com/apache/arrow/blob/main/python/pyarrow/_substrait.pyx#L29
Component(s)
Python
The text was updated successfully, but these errors were encountered: