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

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


The following commit(s) were added to refs/heads/main by this push:
     new 1e769b0abf MINOR: [Docs][Python] Correct type for requested_schema in 
docstring of __arrow_c_stream__ (#38848)
1e769b0abf is described below

commit 1e769b0abfa24a59708648d8124e54598dc8bc9c
Author: Joris Van den Bossche <[email protected]>
AuthorDate: Wed Nov 22 18:15:17 2023 +0100

    MINOR: [Docs][Python] Correct type for requested_schema in docstring of 
__arrow_c_stream__ (#38848)
    
    The implementation is correct, but I just noticed that the docstring wasn't 
fully correct (indicating you could pass a pyarrow Schema, but this actually 
need to be a PyCapsule). In the docstring of `__arrow_c_array__` it is 
documented correctly.
    
    Authored-by: Joris Van den Bossche <[email protected]>
    Signed-off-by: Joris Van den Bossche <[email protected]>
---
 python/pyarrow/ipc.pxi   | 10 ++++++----
 python/pyarrow/table.pxi | 18 ++++++++++++------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/python/pyarrow/ipc.pxi b/python/pyarrow/ipc.pxi
index 5d20a4f8b7..ae52f5cf34 100644
--- a/python/pyarrow/ipc.pxi
+++ b/python/pyarrow/ipc.pxi
@@ -823,10 +823,12 @@ cdef class RecordBatchReader(_Weakrefable):
 
         Parameters
         ----------
-        requested_schema: Schema, default None
-            The schema to which the stream should be casted. Currently, this is
-            not supported and will raise a NotImplementedError if the schema 
-            doesn't match the current schema.
+        requested_schema : PyCapsule, default None
+            The schema to which the stream should be casted, passed as a
+            PyCapsule containing a C ArrowSchema representation of the
+            requested schema.
+            Currently, this is not supported and will raise a
+            NotImplementedError if the schema doesn't match the current schema.
 
         Returns
         -------
diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi
index e55a0d1dd5..0fa913a219 100644
--- a/python/pyarrow/table.pxi
+++ b/python/pyarrow/table.pxi
@@ -3039,9 +3039,12 @@ cdef class RecordBatch(_Tabular):
 
         Parameters
         ----------
-        requested_schema : pyarrow.lib.Schema, default None
-            A schema to attempt to cast the streamed data to. This is currently
-            unsupported and will raise an error.
+        requested_schema : PyCapsule, default None
+            The schema to which the stream should be casted, passed as a
+            PyCapsule containing a C ArrowSchema representation of the
+            requested schema.
+            Currently, this is not supported and will raise a
+            NotImplementedError if the schema doesn't match the current schema.
 
         Returns
         -------
@@ -4859,9 +4862,12 @@ cdef class Table(_Tabular):
 
         Parameters
         ----------
-        requested_schema : pyarrow.lib.Schema, default None
-            A schema to attempt to cast the streamed data to. This is currently
-            unsupported and will raise an error.
+        requested_schema : PyCapsule, default None
+            The schema to which the stream should be casted, passed as a
+            PyCapsule containing a C ArrowSchema representation of the
+            requested schema.
+            Currently, this is not supported and will raise a
+            NotImplementedError if the schema doesn't match the current schema.
 
         Returns
         -------

Reply via email to