pitrou commented on code in PR #45818:
URL: https://github.com/apache/arrow/pull/45818#discussion_r2135999901


##########
python/pyarrow/tests/test_scalars.py:
##########
@@ -238,13 +249,16 @@ def test_numerics():
     assert repr(s) == "<pyarrow.DoubleScalar: 1.5>"
     assert str(s) == "1.5"
     assert s.as_py() == 1.5
+    assert float(s) == 1.5
+    assert int(s) == 1
 
     # float16
     s = pa.scalar(0.5, type='float16')
     assert isinstance(s, pa.HalfFloatScalar)
     assert repr(s) == "<pyarrow.HalfFloatScalar: 0.5>"
     assert str(s) == "0.5"
     assert s.as_py() == 0.5
+    assert int(s) == 0

Review Comment:
   How about also testing `float(s)`? I suppose that should work?
   ```suggestion
       assert float(s) == 1.5
       assert int(s) == 0
   ```



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to