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

Function test_arithmetic_dunders

python/pyarrow/tests/test_array.py:4646–4656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4644
4645
4646def test_arithmetic_dunders():
4647 # GH-32007
4648 arr1 = pa.array([-1.1, 2.2, -3.3])
4649 arr2 = pa.array([2.2, 4.4, 5.5])
4650
4651 assert (arr1 + arr2).equals(pc.add_checked(arr1, arr2))
4652 assert (arr2 / arr1).equals(pc.divide_checked(arr2, arr1))
4653 assert (arr1 * arr2).equals(pc.multiply_checked(arr1, arr2))
4654 assert (-arr1).equals(pc.negate_checked(arr1))
4655 assert (arr1 ** 2).equals(pc.power_checked(arr1, 2))
4656 assert (arr1 - arr2).equals(pc.subtract_checked(arr1, arr2))
4657
4658
4659def test_bitwise_dunders():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected