milesgranger commented on code in PR #14698:
URL: https://github.com/apache/arrow/pull/14698#discussion_r1029742029


##########
python/pyarrow/_flight.pyx:
##########
@@ -1548,6 +1548,9 @@ cdef class FlightClient(_Weakrefable):
         writer : FlightStreamWriter
         reader : FlightMetadataReader
         """
+        if schema is None:

Review Comment:
   Updated in 
https://github.com/apache/arrow/pull/14698/commits/d38124fc1276757c2eb04b8c77afc67247284766,
 when testing with removing the `not None` check, the error is somewhat 
uninformative so left the `not None` in Cython.
   
   ```python
   In [1]: import pyarrow.flight as flight
   
   In [2]: client = flight.FlightClient('grpc+tls://localhost:9643', 
disable_server_verification=True)
   
   In [3]: client.do_put(flight.FlightDescriptor.for_command('foo'), 
schema=None)
   ---------------------------------------------------------------------------
   FlightUnavailableError                    Traceback (most recent call last)
   Cell In [3], line 1
   ----> 1 client.do_put(flight.FlightDescriptor.for_command('foo'), 
schema=None)
   
   File ~/Projects/arrow/python/pyarrow/_flight.pyx:1559, in 
pyarrow._flight.FlightClient.do_put()
      1557
      1558         with nogil:
   -> 1559             check_flight_status(self.client.get().DoPut(
      1560                 deref(c_options),
      1561                 c_descriptor,
   
   File ~/Projects/arrow/python/pyarrow/_flight.pyx:71, in 
pyarrow._flight.check_flight_status()
        69             raise FlightUnauthorizedError(message, detail_msg)
        70         elif detail.get().code() == CFlightStatusUnavailable:
   ---> 71             raise FlightUnavailableError(message, detail_msg)
        72
        73 size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
   
   FlightUnavailableError: Flight returned unavailable error, with message: 
failed to connect to all  
   addresses; last error: UNKNOWN: Failed to connect to remote host: Connection 
refused. gRPC 
   client debug context: UNKNOWN:Failed to pick subchannel 
{created_time:"2022-11-
   22T20:23:29.049965339+01:00", children:[UNKNOWN:failed to connect to all 
addresses; last error: 
   UNKNOWN: Failed to connect to remote host: Connection refused 
{grpc_status:14, 
   created_time:"2022-11-22T20:23:29.049961187+01:00"}]}. Additionally, could 
not finish writing 
   record batches before closing. Client context: Invalid: nullptr for Schema 
not allowed.
   ```



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to