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
Describe the enhancement requested
The built-in numbers module 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.
Component(s)
Python