pitrou commented on code in PR #13041:
URL: https://github.com/apache/arrow/pull/13041#discussion_r869087167


##########
python/pyarrow/tests/test_flight.py:
##########
@@ -2027,6 +2027,27 @@ def test_large_descriptor():
             client.do_exchange(large_descriptor)
 
 
+def test_write_batch_custom_metadata():
+    data = pa.Table.from_arrays([
+        pa.array(range(0, 10 * 1024))
+    ], names=["a"])
+    batches = data.to_batches()
+
+    with ExchangeFlightServer() as server, \
+            FlightClient(("localhost", server.port)) as client:
+        descriptor = flight.FlightDescriptor.for_command(b"put")
+        writer, reader = client.do_exchange(descriptor)
+        with writer:
+            writer.begin(data.schema)
+            for i, batch in enumerate(batches):
+                writer.write_batch(batch, {"batch_id": str(i)})
+            writer.done_writing()
+            chunk = reader.read_chunk()
+            assert chunk.data is None
+            expected_buf = str(len(batches)).encode("utf-8")
+            assert chunk.app_metadata == expected_buf

Review Comment:
   It's not clear to me this test is actually ensuring the metadata was sent 
and received, am I missing something?



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