torcharrow
torcharrow copied to clipboard
Remove numeric related method from String/List/Map columns
trafficstars
>>> import torcharrow as ta
>>> a = ta.Column(['a', 'b'])
>>> help(a)
It shows some numeric related methods , although it's a string column:
...
| __neg__(self)
| Vectorized: -a.
...
| __pos__(self)
| Vectorized: +a.
|
| __pow__(self, other)
| Vectorized a ** b.
...
| cumsum(self)
| Return cumulative sum of the data.
...
| sum(self)
| Return sum of all non-null elements.
|
| Examples
| --------
| >>> import torcharrow as ta
| >>> s = ta.Column([1,2,None,4])
| >>> s.sum()
| 7
...
| floor(self)
| Rounds each value downward to the largest integral value
...
Those methods will throw when execute on string column.
We should move these methods interface into INumericColumn. Otherwise it's confusing for these methods to also show in string/list/map columns.