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

Method Write

python/pyarrow/src/arrow/python/io.cc:124–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 Status Write(const void* data, int64_t nbytes) {
125 RETURN_NOT_OK(CheckClosed());
126
127 // Since the data isn't owned, we have to make a copy
128 PyObject* py_data =
129 PyBytes_FromStringAndSize(reinterpret_cast<const char*>(data), nbytes);
130 PY_RETURN_IF_ERROR(StatusCode::IOError);
131
132 PyObject* result = cpp_PyObject_CallMethod(file_.obj(), "write", "(O)", py_data);
133 Py_XDECREF(py_data);
134 Py_XDECREF(result);
135 PY_RETURN_IF_ERROR(StatusCode::IOError);
136 return Status::OK();
137 }
138
139 Status Write(const std::shared_ptr<Buffer>& buffer) {
140 RETURN_NOT_OK(CheckClosed());

Callers

nothing calls this directly

Calls 3

cpp_PyObject_CallMethodFunction · 0.85
CheckClosedFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected