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

Function IntegerOverflowStatus

python/pyarrow/src/arrow/python/helpers.cc:161–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159namespace {
160
161Status IntegerOverflowStatus(PyObject* obj, const std::string& overflow_message) {
162 if (overflow_message.empty()) {
163 std::string obj_as_stdstring;
164 RETURN_NOT_OK(PyObject_StdStringStr(obj, &obj_as_stdstring));
165 return Status::Invalid("Value ", obj_as_stdstring,
166 " too large to fit in C integer type");
167 } else {
168 return Status::Invalid(overflow_message);
169 }
170}
171
172Result<OwnedRef> PyObjectToPyInt(PyObject* obj) {
173 // Try to call __index__ or __int__ on `obj`

Callers 1

CIntFromPythonImplFunction · 0.85

Calls 3

PyObject_StdStringStrFunction · 0.85
InvalidFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected