MCPcopy Create free account
hub / github.com/apache/arrow / CapsulizeArray

Function CapsulizeArray

python/pyarrow/src/arrow/python/arrow_to_pandas.cc:222–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222Status CapsulizeArray(const std::shared_ptr<Array>& arr, PyObject** out) {
223 auto capsule = new ArrayCapsule{{arr}};
224 *out = PyCapsule_New(reinterpret_cast<void*>(capsule), "arrow::Array",
225 &ArrayCapsule_Destructor);
226 if (*out == nullptr) {
227 delete capsule;
228 RETURN_IF_PYERROR();
229 }
230 return Status::OK();
231}
232
233Status CapsulizeBuffer(const std::shared_ptr<Buffer>& buffer, PyObject** out) {
234 auto capsule = new BufferCapsule{{buffer}};

Callers 1

MakeNumPyViewFunction · 0.85

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected