GH-50431: [Python] Make FlightError a non-cdef class for abi3 wheel precursor#50427
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Python Flight exception hierarchy to support building toward abi3 wheels by removing FlightError (and its key subclasses) as Cython cdef class types, since Cython limited-API builds can’t support cdef classes inheriting from Python classes like Exception.
Changes:
- Convert
FlightErrorand its main subclasses fromcdef classto regular Pythonclass. - Replace per-subclass
to_status()Cython methods with a centralized_flight_error_to_status()helper that mapsFlightErrorinstances to the appropriatearrow::flight::MakeFlightError(...)status. - Update all server/callback exception translation sites to use
_flight_error_to_status(...)instead of casting and callingto_status().
lidavidm
left a comment
There was a problem hiding this comment.
It seems reasonable.
Is this the only change needed for the linked issue? It may be better to file this as a subissue?
Sure opened #50431 and linked it in the OP. (I don't think I have permissions to create subissues from the other linked issue) |
|
I tried to merge this but GitHub seems to be borked. I'll try again later. |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 38efbf7. There were 4 benchmark results indicating a performance regression:
The full Conbench report has more details. It also includes information about 87 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Towards #50398
closes #50431
What changes are included in this PR?
This is an agent generated PR that makes
FlightErrora non-cdef subclass ofExceptionas Cython does not support building with the Limited API and cdef classes that inherit from Python classes.It appears before a
cdef CStatus to_statuswas defined on each subclass to return aMakeFlightErrorper flight error flavor. This was pull out to a dedicated_flight_error_to_statusfunction instead.Are these changes tested?
Yes (via existing tests?)
Are there any user-facing changes?
No