You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/09/29 09:02:48 UTC

[arrow] branch master updated: ARROW-3354: [Python] Swap cuda.read_record_batch arguments

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 97da1aa  ARROW-3354: [Python] Swap cuda.read_record_batch arguments
97da1aa is described below

commit 97da1aa6922b24695c8902aae354f06968331bd0
Author: Pearu Peterson <pe...@gmail.com>
AuthorDate: Sat Sep 29 05:02:31 2018 -0400

    ARROW-3354: [Python] Swap cuda.read_record_batch arguments
    
    Author: Pearu Peterson <pe...@gmail.com>
    
    Closes #2657 from pearu/arrow-3354 and squashes the following commits:
    
    3502d6605 <Pearu Peterson> Swap cuda.read_record_batch arguments (ARROW-3354)
---
 python/pyarrow/_cuda.pyx          | 6 +++---
 python/pyarrow/tests/test_cuda.py | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/pyarrow/_cuda.pyx b/python/pyarrow/_cuda.pyx
index 64aa368..29f1bd2 100644
--- a/python/pyarrow/_cuda.pyx
+++ b/python/pyarrow/_cuda.pyx
@@ -636,7 +636,7 @@ def read_message(object source, pool=None):
     return result
 
 
-def read_record_batch(object schema, object buffer, pool=None):
+def read_record_batch(object buffer, object schema, pool=None):
     """Construct RecordBatch referencing IPC message located on CUDA device.
 
     While the metadata is copied to host memory for deserialization,
@@ -644,10 +644,10 @@ def read_record_batch(object schema, object buffer, pool=None):
 
     Parameters
     ----------
-    schema : Schema
-      Specify schema for the record batch
     buffer :
       Specify device buffer containing the complete IPC message
+    schema : Schema
+      Specify schema for the record batch
     pool : {MemoryPool, None}
       Specify pool to use for allocating space for the metadata
 
diff --git a/python/pyarrow/tests/test_cuda.py b/python/pyarrow/tests/test_cuda.py
index 926cc48..d1efd3e 100644
--- a/python/pyarrow/tests/test_cuda.py
+++ b/python/pyarrow/tests/test_cuda.py
@@ -543,7 +543,7 @@ def test_batch_serialize():
     hbuf = batch.serialize()
     cbuf = cuda.serialize_record_batch(batch, global_context)
     # test that read_record_batch works properly:
-    cuda.read_record_batch(batch.schema, cbuf)
+    cuda.read_record_batch(cbuf, batch.schema)
     buf = cbuf.copy_to_host()
     assert hbuf.equals(buf)
     batch2 = pa.read_record_batch(buf, batch.schema)