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

Function IntegerOverflowStatus

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

Source from the content-addressed store, hash-verified

158namespace {
159
160Status IntegerOverflowStatus(PyObject* obj, const std::string& overflow_message) {
161 if (overflow_message.empty()) {
162 std::string obj_as_stdstring;
163 RETURN_NOT_OK(PyObject_StdStringStr(obj, &obj_as_stdstring));
164 return Status::Invalid("Value ", obj_as_stdstring,
165 " too large to fit in C integer type");
166 } else {
167 return Status::Invalid(overflow_message);
168 }
169}
170
171Result<OwnedRef> PyObjectToPyInt(PyObject* obj) {
172 // 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