Skip to content

Commit

Permalink
MINOR: [Docs][Python] Correct type for requested_schema in docstring …
Browse files Browse the repository at this point in the history
…of __arrow_c_stream__ (apache#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]>
  • Loading branch information
jorisvandenbossche authored Nov 22, 2023
1 parent 8cc71ab commit 1e769b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
10 changes: 6 additions & 4 deletions python/pyarrow/ipc.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
18 changes: 12 additions & 6 deletions python/pyarrow/table.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down

0 comments on commit 1e769b0

Please sign in to comment.