pitrou commented on code in PR #45818:
URL: https://github.com/apache/arrow/pull/45818#discussion_r2102421005


##########
python/pyarrow/scalar.pxi:
##########
@@ -238,6 +241,9 @@ cdef class UInt8Scalar(Scalar):
         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.wrapped.get()
         return sp.value if sp.is_valid else None
 
+    def __int__(self):
+        return self.as_py()

Review Comment:
   Hmm, you may want to report a bug for this.
   
   Here, however, you don't need to use Arrow casting. You can instead just 
write something like:
   ```python
   def __int__(self):
       return int(float(self))
   ```
   and it will return an arbitrary precision Python 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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to