pitrou commented on code in PR #14583:
URL: https://github.com/apache/arrow/pull/14583#discussion_r1017819803
##########
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 problem is that the test might succeed now if `from_batches` succeeds
but `str` raises. So we should remove this `str` call, IMHO.
--
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]