Skip to content

Commit

Permalink
docs(python): use public API to consume stream handle (apache#2105)
Browse files Browse the repository at this point in the history
Small follow-up on apache#2097

This method is available starting from pyarrow 15.0, only one release
after introduction of the general protocol, so I think it should be fine
to just use that.
  • Loading branch information
jorisvandenbossche authored Aug 27, 2024
1 parent 7925c42 commit 08ced8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/python/recipe/driver_manager_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#: (other drivers, like the PostgreSQL driver, may know).
assert rowcount == -1
#: We can use the PyArrow APIs to read the result.
reader = pyarrow.RecordBatchReader._import_from_c_capsule(handle.__arrow_c_stream__())
reader = pyarrow.RecordBatchReader.from_stream(handle)
assert reader.schema == pyarrow.schema([("THEANSWER", "int64")])
#: Finally, we have to clean up all the objects. (They also support the
#: context manager protocol.)
Expand Down

0 comments on commit 08ced8d

Please sign in to comment.