pitrou commented on code in PR #46618: URL: https://github.com/apache/arrow/pull/46618#discussion_r2111678572
########## python/pyarrow/tests/test_array.py: ########## @@ -1664,6 +1664,16 @@ def test_floating_point_truncate_unsafe(): _check_cast_case(case, safe=False) +def test_half_float_array_from_python(): + # GH-46611 + arr = pa.array([1.0, 2.0, 3, None], type=pa.float16()) + assert arr.type == pa.float16() + assert arr.to_pylist() == [1.0, 2.0, 3.0, None] + msg1 = "Could not convert 'a' with type str: tried to convert to float16" + with pytest.raises(pa.ArrowInvalid, match=msg1): + arr = pa.array(['a', 3, None], type=pa.float16()) Review Comment: Ah, right, I hadn't noticed. -- 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