jorisvandenbossche commented on a change in pull request #8044:
URL: https://github.com/apache/arrow/pull/8044#discussion_r478880416



##########
File path: cpp/src/arrow/python/python_to_arrow.cc
##########
@@ -106,7 +106,12 @@ struct ValueConverter<Type, enable_if_integer<Type>> {
 
   static inline Result<ValueType> FromPython(PyObject* obj) {
     ValueType value;
-    RETURN_NOT_OK(internal::CIntFromPython(obj, &value));
+    arrow::Status s_ = internal::CIntFromPython(obj, &value);
+    if (!s_.ok() && !internal::PyIntScalar_Check(obj)) {
+      return internal::InvalidValue(obj, "tried to convert to int");
+    } else {
+      RETURN_NOT_OK(s_);

Review comment:
       What are the cases that this couldn't be converted, but that `obj` *is* 
an integer? When the integer is too big to fit in a C int?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to