lidavidm commented on a change in pull request #10893:
URL: https://github.com/apache/arrow/pull/10893#discussion_r684238270



##########
File path: python/pyarrow/tests/test_flight.py
##########
@@ -1545,6 +1578,48 @@ def test_roundtrip_errors():
         with pytest.raises(flight.FlightInternalError, match=".*foo.*"):
             list(client.list_flights())
 
+        with pytest.raises(flight.FlightInternalError, match=".*foo.*"):
+            writer, reader = 
client.do_put(flight.FlightDescriptor.for_command("internal"))

Review comment:
       do_put also needs the schema (so pass table.schema as the second 
argument)

##########
File path: python/pyarrow/tests/test_flight.py
##########
@@ -1545,6 +1578,48 @@ def test_roundtrip_errors():
         with pytest.raises(flight.FlightInternalError, match=".*foo.*"):
             list(client.list_flights())
 
+        with pytest.raises(flight.FlightInternalError, match=".*foo.*"):

Review comment:
       Maybe we can put these errors in a list and loop over them, and then 
test both close() and write_table() separately? Something like
   
   ```python
   exceptions = [flight.FlightInternalError, flight.FlightTimedOutError, ...]
   for exception in exception:
       with pytest.raises(exception, match=...):
           writer, reader = client.do_put(...)
           writer.close()
       with pytest.raises(exception, match=...):
           writer, reader = client.do_put(...)
           writer.write_table(table)
           writer.close()
   ```




-- 
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]


Reply via email to