AlenkaF commented on code in PR #33698:
URL: https://github.com/apache/arrow/pull/33698#discussion_r1073308531


##########
python/pyarrow/io.pxi:
##########
@@ -1459,23 +1484,21 @@ cdef class BufferReader(NativeFile):
 
     Examples
     --------
+    Create an Arrow input stream and inspect it:
 
     >>> import pyarrow as pa
     >>> data = b'reader data'
-    >>> f = pa.BufferReader(data)
-    >>> f.size()
+    >>> buf = memoryview(data)

Review Comment:
   It needs some kind of a source ([str, Path, buffer, file-like object, 
…](https://docs.python.org/3/library/stdtypes.html#str)):
   
   ```python
   >>> import pyarrow as pa
   >>> data = b'reader data'
   >>> with pa.input_stream(data) as stream:
   ...     stream.size()
   ... 
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "pyarrow/io.pxi", line 2403, in pyarrow.lib.input_stream
       hasattr(source, 'closed')):
   TypeError: pa.input_stream() called with instance of '<class 'bytes'>'
   ```
   Can change the source, if preferred.



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to