MCPcopy Create free account
hub / github.com/apache/arrow / test_arithmetic_dunders

Function test_arithmetic_dunders

python/pyarrow/tests/test_scalars.py:1001–1011  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

999
1000
1001def test_arithmetic_dunders():
1002 # GH-32007
1003 scl1 = pa.scalar(42)
1004 scl2 = pa.scalar(-17)
1005
1006 assert (scl1 + scl2).equals(pc.add_checked(scl1, scl2))
1007 assert (scl2 / scl1).equals(pc.divide_checked(scl2, scl1))
1008 assert (scl1 * scl2).equals(pc.multiply_checked(scl1, scl2))
1009 assert (-scl1).equals(pc.negate_checked(scl1))
1010 assert (scl1 ** 2).equals(pc.power_checked(scl1, 2))
1011 assert (scl1 - scl2).equals(pc.subtract_checked(scl1, scl2))
1012
1013
1014def test_bitwise_dunders():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
scalarMethod · 0.45

Tested by

no test coverage detected