no23reason opened a new issue, #34431: URL: https://github.com/apache/arrow/issues/34431
### Describe the enhancement requested ### Use case In certain situations, client code using the FlightClient to perform the DoPut operation might need to cancel half way through writing (for example because its underlying data source threw an exception). The explicit cancellation is useful when the server wants to avoid saving partially written flights when client cancels. Currently, there is no explicit way to do so in Python (at least the docs do not mention any and I was not able to find one in source code either). ### Suggested solution The `FlightStreamWriter` has a new `cancel(self)` method that cancels the underlying stream so that the server receives the information that the client has cancelled. ### Related implementation/Prior art The use case is already possible In Java client. There is the `error(Throwable ex)` method of `OutboundStreamListener` that the client code can call and it will end the stream so that the server knows the operation was cancelled - `server_call_context.is_cancelled()` returns `True`. Also, the complementary Python `FlightStreamReader` already has a `cancel(self)` method with similar semantics. ### Component(s) FlightRPC, Python -- 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]
