amol- commented on a change in pull request #10957:
URL: https://github.com/apache/arrow/pull/10957#discussion_r691045804
##########
File path: docs/source/python/ipc.rst
##########
@@ -89,10 +88,11 @@ convenience function ``pyarrow.ipc.open_stream``:
.. ipython:: python
- reader = pa.ipc.open_stream(buf)
- reader.schema
-
- batches = [b for b in reader]
+ with pa.ipc.open_stream(buf) as reader:
+ schema = reader.schema
+ batches = [b for b in reader]
Review comment:
Took me a while to get around this one, if you wonder why this block is
indented to more spaces than the other blocks, it's to work around what seemed
like a bug in ipython directive.
When indented normally the second line was parsed as outside of the `with`
block
```
In [0]: with pa.ipc.open_stream(buf) as reader:
...: schema = reader.schema
In [1]: batches = [b for b in reader]
```
instead of
```
In [0]: with pa.ipc.open_stream(buf) as reader:
...: schema = reader.schema
...: batches = [b for b in reader]
```
--
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]