jorisvandenbossche commented on code in PR #14583:
URL: https://github.com/apache/arrow/pull/14583#discussion_r1017815603


##########
python/pyarrow/tests/test_ipc.py:
##########
@@ -1153,9 +1153,17 @@ def make_batches():
     batches = iter(UserList(make_batches()))  # weakrefable
     wr = weakref.ref(batches)
 
-    with pa.ipc.RecordBatchReader.from_batches(make_schema(),
-                                               batches) as reader:
+    with pa.RecordBatchReader.from_batches(make_schema(),
+                                           batches) as reader:
         batches = None
         assert wr() is not None
         assert list(reader) == make_batches()
         assert wr() is None
+
+    # ensure we get proper error when not passing a schema
+    # (https://issues.apache.org/jira/browse/ARROW-18229)
+    batches = make_batches()
+    with pytest.raises(TypeError):
+        reader = pa.RecordBatchReader.from_batches(
+            [('field', pa.int64())], batches)
+        str(reader.schema)

Review Comment:
   With this PR, it is the `from_batches` that is already raising the 
TypeErrror, but the original segfault came from inspecting a null schema, so 
therefore I left the code that reproduced the original issue (although now it 
it not strictly needed)



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