jorisvandenbossche commented on a change in pull request #9784:
URL: https://github.com/apache/arrow/pull/9784#discussion_r603328337
##########
File path: docs/source/python/extending.rst
##########
@@ -71,157 +74,184 @@ pyarrow provides the following functions to go back and
forth between
Python wrappers (as exposed by the pyarrow Python API) and the underlying
C++ objects.
-.. function:: bool is_array(PyObject* obj)
+.. function:: bool arrow::py::is_array(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Array` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Array` instance.
-.. function:: bool is_buffer(PyObject* obj)
+.. function:: bool arrow::py::is_batch(PyObject* obj)
+
+ Return whether *obj* wraps an Arrow C++ :class:`RecordBatch` pointer;
+ in other words, whether *obj* is a :py:class:`pyarrow.RecordBatch` instance.
+
+.. function:: bool arrow::py::is_buffer(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Buffer` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Buffer` instance.
-.. function:: bool is_data_type(PyObject* obj)
+.. function:: bool arrow::py::is_data_type(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`DataType` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.DataType` instance.
-.. function:: bool is_field(PyObject* obj)
+.. function:: bool arrow::py::is_field(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Field` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Field` instance.
-.. function:: bool is_record_batch(PyObject* obj)
+.. function:: bool arrow::py::is_scalar(PyObject* obj)
- Return whether *obj* wraps an Arrow C++ :class:`RecordBatch` pointer;
- in other words, whether *obj* is a :py:class:`pyarrow.RecordBatch` instance.
+ Return whether *obj* wraps an Arrow C++ :class:`Scalar` pointer;
+ in other words, whether *obj* is a :py:class:`pyarrow.Scalar` instance.
-.. function:: bool is_schema(PyObject* obj)
+.. function:: bool arrow::py::is_schema(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Schema` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Schema` instance.
-.. function:: bool is_table(PyObject* obj)
+.. function:: bool arrow::py::is_table(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Table` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Table` instance.
-.. function:: bool is_tensor(PyObject* obj)
+.. function:: bool arrow::py::is_tensor(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`Tensor` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.Tensor` instance.
-.. function:: bool is_sparse_coo_tensor(PyObject* obj)
+.. function:: bool arrow::py::is_sparse_coo_tensor(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`SparseCOOTensor` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.SparseCOOTensor`
instance.
-.. function:: bool is_sparse_csr_matrix(PyObject* obj)
+.. function:: bool arrow::py::is_sparse_csc_matrix(PyObject* obj)
+
+ Return whether *obj* wraps an Arrow C++ :class:`SparseCSCMatrix` pointer;
+ in other words, whether *obj* is a :py:class:`pyarrow.SparseCSCMatrix`
instance.
+
+.. function:: bool arrow::py::is_sparse_csf_tensor(PyObject* obj)
+
+ Return whether *obj* wraps an Arrow C++ :class:`SparseCSFTensor` pointer;
+ in other words, whether *obj* is a :py:class:`pyarrow.SparseCSFTensor`
instance.
+
+.. function:: bool arrow::py::is_sparse_csr_matrix(PyObject* obj)
Return whether *obj* wraps an Arrow C++ :class:`SparseCSRMatrix` pointer;
in other words, whether *obj* is a :py:class:`pyarrow.SparseCSRMatrix`
instance.
-.. function:: bool is_sparse_csc_matrix(PyObject* obj)
-
- Return whether *obj* wraps an Arrow C++ :class:`SparseCSCMatrix` pointer;
- in other words, whether *obj* is a :py:class:`pyarrow.SparseCSCMatrix`
instance.
The following functions expect a pyarrow object, unwrap the underlying
-Arrow C++ API pointer, and put it in the *out* parameter. The returned
-:class:`Status` object must be inspected first to know whether any error
-occurred. If successful, *out* is guaranteed to be non-NULL.
+Arrow C++ API pointer, and return it as a :class:`Result` object. An error
+may be returned if the input object doesn't have the expected type.
+
+.. function:: Result<std::shared_ptr<Array>> arrow::py::unwrap_array(PyObject*
obj)
+
+ Unwrap and return the Arrow C++ :class:`Array` pointer from *obj*.
-.. function:: Status unwrap_array(PyObject* obj, std::shared_ptr<Array>* out)
+.. function:: Result<std::shared_ptr<RecordBatch>>
arrow::py::unwrap_batch(PyObject* obj)
Review comment:
Just to understand the change: this was already changed before in C++,
and the documentation was just outdated?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]