ump45nose opened a new pull request, #55310: URL: https://github.com/apache/arrow/pull/55310
### 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](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [ ] Human - [x] AI **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
