You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "tswast (via GitHub)" <gi...@apache.org> on 2026/07/09 17:36:09 UTC

[I] [Python] Int64Scalar and related instances should subclass the appropriate numbers abstract base class (abc) [arrow]

tswast opened a new issue, #50454:
URL: https://github.com/apache/arrow/issues/50454

   ### Describe the enhancement requested
   
   The built-in [numbers module](https://docs.python.org/3/library/numbers.html#module-numbers) provides abstract base classes for checking for various kinds of numbers. It would be helpful if pyarrow integer scalar values derived from these classes for more robust checks in code that might accept pyarrow values.
   
   ```
   In [1]: import numpy as np
   
   In [2]: import numbers
   
   In [3]: isinstance(123, numbers.Integral)
   Out[3]: True
   
   In [6]: v = np.int64(123)
   
   In [7]: isinstance(v, numbers.Integral)
   Out[7]: True
   
   In [8]: isinstance(v, int)
   Out[8]: False
   
   In [9]: import pyarrow as pa
   
   In [10]: vv = pa.scalar(123)
   
   In [11]: vv
   Out[11]: <pyarrow.Int64Scalar: 123>
   
   In [13]: isinstance(vv, numbers.Integral)
   Out[13]: False
   ```
   
   ### Component(s)
   
   Python


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Python] Int64Scalar and related instances should subclass the appropriate numbers abstract base class (abc) [arrow]

Posted by "jingyi-zhao-01 (via GitHub)" <gi...@apache.org>.
jingyi-zhao-01 commented on issue #50454:
URL: https://github.com/apache/arrow/issues/50454#issuecomment-4950845008

   i would like to investigate on this, 
   probably first protytype abstract interface for Int, float point and decimal scalars and verify whether virtual registration is preferable to cython, 
   will also add tests covering signed/unsigned data types before proposing implementation 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org