arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-1028: [Python] Fix IPC docs per API changes
Date Mon, 15 May 2017 13:05:13 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 37dbddf0d -> 054337947


ARROW-1028: [Python] Fix IPC docs per API changes

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #687 from wesm/python-update-ipc-docs and squashes the following commits:

a502abe [Wes McKinney] Fix IPC docs per API changes


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/05433794
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/05433794
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/05433794

Branch: refs/heads/master
Commit: 05433794783398041ebde6972c278cf5698164b1
Parents: 37dbddf
Author: Wes McKinney <wes.mckinney@twosigma.com>
Authored: Mon May 15 09:05:07 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Mon May 15 09:05:07 2017 -0400

----------------------------------------------------------------------
 python/doc/source/ipc.rst | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/05433794/python/doc/source/ipc.rst
----------------------------------------------------------------------
diff --git a/python/doc/source/ipc.rst b/python/doc/source/ipc.rst
index cce2ae8..c7de9c4 100644
--- a/python/doc/source/ipc.rst
+++ b/python/doc/source/ipc.rst
@@ -55,13 +55,13 @@ First, let's create a small record batch:
    batch.num_columns
 
 Now, we can begin writing a stream containing some number of these batches. For
-this we use :class:`~pyarrow.BatchStreamWriter`, which can write to a writeable
+this we use :class:`~pyarrow.RecordBatchStreamWriter`, which can write to a writeable
 ``NativeFile`` object or a writeable Python object:
 
 .. ipython:: python
 
    sink = pa.InMemoryOutputStream()
-   writer = pa.BatchStreamWriter(sink, batch.schema)
+   writer = pa.RecordBatchStreamWriter(sink, batch.schema)
 
 Here we used an in-memory Arrow buffer stream, but this could have been a
 socket or some other IO sink.
@@ -80,11 +80,12 @@ particular stream. Now we can do:
    buf.size
 
 Now ``buf`` contains the complete stream as an in-memory byte buffer. We can
-read such a stream with :class:`~pyarrow.BatchStreamReader`:
+read such a stream with :class:`~pyarrow.RecordBatchStreamReader` or the
+convenience function ``pyarrow.open_stream``:
 
 .. ipython:: python
 
-   reader = pa.BatchStreamReader(buf)
+   reader = pa.open_stream(buf)
    reader.schema
 
    batches = [b for b in reader]
@@ -103,13 +104,13 @@ batches are also zero-copy and do not allocate any new memory on read.
 Writing and Reading Random Access Files
 ---------------------------------------
 
-The :class:`~pyarrow.BatchFileWriter` has the same API as
-:class:`~pyarrow.BatchStreamWriter`:
+The :class:`~pyarrow.RecordBatchFileWriter` has the same API as
+:class:`~pyarrow.RecordBatchStreamWriter`:
 
 .. ipython:: python
 
    sink = pa.InMemoryOutputStream()
-   writer = pa.BatchFileWriter(sink, batch.schema)
+   writer = pa.RecordBatchFileWriter(sink, batch.schema)
 
    for i in range(10):
       writer.write_batch(batch)
@@ -118,14 +119,14 @@ The :class:`~pyarrow.BatchFileWriter` has the same API as
    buf = sink.get_result()
    buf.size
 
-The difference between :class:`~pyarrow.BatchFileReader` and
-:class:`~pyarrow.BatchStreamReader` is that the input source must have a
+The difference between :class:`~pyarrow.RecordBatchFileReader` and
+:class:`~pyarrow.RecordBatchStreamReader` is that the input source must have a
 ``seek`` method for random access. The stream reader only requires read
-operations:
+operations. We can also use the ``pyarrow.open_file`` method to open a file:
 
 .. ipython:: python
 
-   reader = pa.BatchFileReader(buf)
+   reader = pa.open_file(buf)
 
 Because we have access to the entire payload, we know the number of record
 batches in the file, and can read any at random:


Mime
View raw message