jorisvandenbossche commented on code in PR #14583:
URL: https://github.com/apache/arrow/pull/14583#discussion_r1017820400
##########
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:
> the original segfault came from inspecting a null schema
That's probably something to fix separately as well, although there is no
way to create such a null schema from Python manually, except through a bug
like this (it is the cython `shared_ptr[CSchema]()`)
--
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]