Skip to content

Commit 0ba81e5

Browse files
committed
Revert "docs: clarify return values for Arrow C Array export in documentation and type hints"
This reverts commit 758fa13.
1 parent 758fa13 commit 0ba81e5

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

docs/source/user-guide/io/arrow.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ To import an Arrow table, use :py:func:`datafusion.context.SessionContext.from_a
3535
This will accept any Python object that implements
3636
`__arrow_c_stream__ <https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#arrowstream-export>`_
3737
or `__arrow_c_array__ <https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#arrowarray-export>`_
38-
and returns a ``StructArray``.
39-
40-
.. note::
41-
``__arrow_c_array__`` must return ``(array_capsule, schema_capsule)``.
42-
43-
Common pyarrow sources you can use are:
38+
and returns a ``StructArray``. Common pyarrow sources you can use are:
4439

4540
- `Array <https://arrow.apache.org/docs/python/generated/pyarrow.Array.html>`_ (but it must return a Struct Array)
4641
- `Record Batch <https://arrow.apache.org/docs/python/generated/pyarrow.RecordBatch.html>`_

python/datafusion/context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ class ArrowArrayExportable(Protocol):
6464
"""Type hint for object exporting Arrow C Array via Arrow PyCapsule Interface.
6565
6666
https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
67-
68-
The method should return ``(array_capsule, schema_capsule)``.
6967
"""
7068

7169
def __arrow_c_array__( # noqa: D105

python/datafusion/record_batch.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ def __arrow__(self, *args: object, **kwargs: object) -> pa.RecordBatch:
5757
def __arrow_c_array__(
5858
self, requested_schema: object | None = None
5959
) -> tuple[object, object]:
60-
"""Arrow C Data Interface export.
61-
62-
Returns:
63-
tuple[object, object]: ``(array_capsule, schema_capsule)``
64-
"""
60+
"""Arrow C Data Interface export."""
6561
return self.record_batch.__arrow_c_array__(requested_schema)
6662

6763

src/record_batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl PyRecordBatch {
142142
.downcast_into::<PyCapsule>()
143143
.unwrap();
144144

145-
Ok((array_capsule, schema_capsule))
145+
Ok((schema_capsule, array_capsule))
146146
}
147147
}
148148
}

0 commit comments

Comments
 (0)