jorisvandenbossche commented on code in PR #13109:
URL: https://github.com/apache/arrow/pull/13109#discussion_r885486000


##########
python/pyarrow/tests/test_compute.py:
##########
@@ -1702,6 +1702,18 @@ def test_logical():
 
 
 def test_cast():
+    arr = pa.array([1, 2, 3, 4], type='int64')
+    options = pc.CastOptions()
+
+    with pytest.raises(ValueError):
+        pc.cast(arr, target_type=None)
+
+    with pytest.raises(ValueError):
+        pc.cast(arr, 'int32', safe=True, options=options)
+
+    with pytest.raises(ValueError):
+        pc.cast(arr, 'int32', safe=False, options=options)
+

Review Comment:
   I think we should also still test with a non-default `pc.CastOptions`, to 
ensure we are really testing that the options object is passed through (the 
test below `pc.cast(arr, 'int8', options=options)` would also pass if `options` 
was not specified)



-- 
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