You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by uw...@apache.org on 2017/03/24 10:58:42 UTC

arrow git commit: ARROW-595: [Python] Set schema attribute on StreamReader

Repository: arrow
Updated Branches:
  refs/heads/master 13c12c6ea -> bc185a41a


ARROW-595: [Python] Set schema attribute on StreamReader

Author: Wes McKinney <we...@twosigma.com>

Closes #434 from wesm/ARROW-595 and squashes the following commits:

484cc7b [Wes McKinney] Set schema attribute on StreamReader


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

Branch: refs/heads/master
Commit: bc185a41a239181d255e72bf255a354da4f5dae6
Parents: 13c12c6
Author: Wes McKinney <we...@twosigma.com>
Authored: Fri Mar 24 11:58:30 2017 +0100
Committer: Uwe L. Korn <uw...@xhochy.com>
Committed: Fri Mar 24 11:58:30 2017 +0100

----------------------------------------------------------------------
 python/pyarrow/io.pyx            | 4 ++--
 python/pyarrow/tests/test_ipc.py | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/bc185a41/python/pyarrow/io.pyx
----------------------------------------------------------------------
diff --git a/python/pyarrow/io.pyx b/python/pyarrow/io.pyx
index 17b43de..72e0e0f 100644
--- a/python/pyarrow/io.pyx
+++ b/python/pyarrow/io.pyx
@@ -933,8 +933,8 @@ cdef class _StreamReader:
         with nogil:
             check_status(CStreamReader.Open(in_stream, &self.reader))
 
-        schema = Schema()
-        schema.init_schema(self.reader.get().schema())
+        self.schema = Schema()
+        self.schema.init_schema(self.reader.get().schema())
 
     def get_next_batch(self):
         """

http://git-wip-us.apache.org/repos/asf/arrow/blob/bc185a41/python/pyarrow/tests/test_ipc.py
----------------------------------------------------------------------
diff --git a/python/pyarrow/tests/test_ipc.py b/python/pyarrow/tests/test_ipc.py
index 665a63b..4c9dad1 100644
--- a/python/pyarrow/tests/test_ipc.py
+++ b/python/pyarrow/tests/test_ipc.py
@@ -104,6 +104,8 @@ class TestStream(MessagingTest, unittest.TestCase):
         file_contents = self._get_source()
         reader = pa.StreamReader(file_contents)
 
+        assert reader.schema.equals(batches[0].schema)
+
         total = 0
         for i, next_batch in enumerate(reader):
             assert next_batch.equals(batches[i])