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

Function CapsulizeArray

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

Source from the content-addressed store, hash-verified

231}
232
233Status CapsulizeArray(const std::shared_ptr<Array>& arr, PyObject** out) {
234 auto capsule = new ArrayCapsule{{arr}};
235 *out = PyCapsule_New(reinterpret_cast<void*>(capsule), "arrow::Array",
236 &ArrayCapsule_Destructor);
237 if (*out == nullptr) {
238 delete capsule;
239 RETURN_IF_PYERROR();
240 }
241 return Status::OK();
242}
243
244Status CapsulizeBuffer(const std::shared_ptr<Buffer>& buffer, PyObject** out) {
245 auto capsule = new BufferCapsule{{buffer}};

Callers 1

MakeNumPyViewFunction · 0.85

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected