You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/18 23:25:39 UTC

[GitHub] [arrow] alexdesiqueira commented on a diff in pull request #13144: ARROW-16356: [Python] Expose RandomAccessFile::GetStream

alexdesiqueira commented on code in PR #13144:
URL: https://github.com/apache/arrow/pull/13144#discussion_r876456543


##########
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:
   Got it. I'll get back to that. Thanks!



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org