Skip to content

GH-35150: [Python] Make Flight value types pickleable - #55310

Open
ump45nose wants to merge 1 commit into
apache:mainfrom
ump45nose:fix/35150-flight-pickle-support
Open

ump45nose wants to merge 1 commit into
apache:mainfrom
ump45nose:fix/35150-flight-pickle-support

Conversation

@ump45nose

@ump45nose ump45nose commented Oct 29, 2026 •

Copy link
Copy Markdown

Rationale for this change

Fixes #35150. Flight value types such as FlightEndpoint cannot be pickled because they do not implement __reduce__, which breaks use cases that move Flight metadata across process boundaries (for example Ray).

What changes are included in this PR?

Add __reduce__ for the Flight value types that already expose wire-format serialize/deserialize (Action, Result, BasicAuth, FlightDescriptor, Ticket, FlightEndpoint, SchemaResult, FlightInfo), reducing through those helpers. Location has no protobuf serialize helper, so it reduces via its URI.

Are these changes tested?

Added test_pickle_flight_types next to the existing serialize round-trip coverage in python/pyarrow/tests/test_flight.py. Full Arrow/Flight builds were not run locally (no Flight-enabled pyarrow on this machine); relying on CI for the Python Flight job.

Are there any user-facing changes?

No breaking API changes. Pickling Flight value types that previously failed now works.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Add __reduce__ for Action, Result, BasicAuth, FlightDescriptor, Ticket,
Location, FlightEndpoint, SchemaResult, and FlightInfo so they round-trip
through pickle (via existing serialize/deserialize, or URI for Location).
@github-actions github-actions Bot added the awaiting review Awaiting review label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #35150 has been automatically assigned in GitHub to PR creator.

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Arrow/Flight builds were not run locally (no Flight-enabled pyarrow on this machine); relying on CI for the Python Flight job.

CI is a scarce resource, especially with the volume of PRs nowadays. The agent should be more than capable of building and testing; I'm not really willing to review if it hasn't done that much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Flight objects like FlightEndpoint cannot be pickled

2 participants