GH-50431: [Python] Make FlightError a non-cdef class for abi3 wheel precursor#50427
Open
mroeschke wants to merge 1 commit into
Open
GH-50431: [Python] Make FlightError a non-cdef class for abi3 wheel precursor#50427mroeschke wants to merge 1 commit into
mroeschke wants to merge 1 commit into
Conversation
Contributor
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
reviewed
Jul 8, 2026
lidavidm
left a comment
Member
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?
Contributor
Author
Sure opened #50431 and linked it in the OP. (I don't think I have permissions to create subissues from the other linked issue) |
lidavidm
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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