pitrou commented on code in PR #13144:
URL: https://github.com/apache/arrow/pull/13144#discussion_r876055701
##########
python/pyarrow/tests/test_io.py:
##########
@@ -125,6 +125,22 @@ def test_python_file_read():
pa.PythonFile(StringIO(), mode='r')
+def test_python_file_get_stream():
+ data = b'data1data2data3data4data5'
+
+ buf = BytesIO(data)
+ f = pa.PythonFile(buf, mode='r')
+
+ stream1 = f.get_stream(file_offset=0, nbytes=10)
+ stream2 = f.get_stream(file_offset=9, nbytes=16)
+
+ buf_nbytes6 = stream1.read(nbytes=6)
+ assert buf_nbytes6 == b'data1d'
Review Comment:
Probably want to exercise this a bit more. When it the end of file reached?
##########
python/pyarrow/tests/test_io.py:
##########
@@ -125,6 +125,22 @@ def test_python_file_read():
pa.PythonFile(StringIO(), mode='r')
+def test_python_file_get_stream():
+ data = b'data1data2data3data4data5'
+
+ buf = BytesIO(data)
+ f = pa.PythonFile(buf, mode='r')
+
+ stream1 = f.get_stream(file_offset=0, nbytes=10)
+ stream2 = f.get_stream(file_offset=9, nbytes=16)
+
+ buf_nbytes6 = stream1.read(nbytes=6)
+ assert buf_nbytes6 == b'data1d'
Review Comment:
Probably want to exercise this a bit more. When is the end of file reached?
--
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]