ARROW-13476: [Doc][Python] Switch ipc/io doc to use context managers#10957
Closed
amol- wants to merge 2 commits into
Closed
ARROW-13476: [Doc][Python] Switch ipc/io doc to use context managers#10957amol- wants to merge 2 commits into
amol- wants to merge 2 commits into
Conversation
amol-
commented
Aug 18, 2021
| batches = [b for b in reader] | ||
| with pa.ipc.open_stream(buf) as reader: | ||
| schema = reader.schema | ||
| batches = [b for b in reader] |
Member
Author
There was a problem hiding this 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.