js8544 commented on code in PR #36891:
URL: https://github.com/apache/arrow/pull/36891#discussion_r1275050655
##########
python/pyarrow/tests/test_compute.py:
##########
@@ -3513,3 +3514,22 @@ def test_pairwise_diff():
with pytest.raises(pa.ArrowInvalid,
match="overflow"):
pa.compute.pairwise_diff_checked(arr, period=-1)
+
+
+def test_adjoin_as_list():
+ arrs = [pa.array([1, 2, None], type=pa.int32()), pa.array(
+ [None, 5, 6], type=pa.int32()), pa.array([None, None, 9],
type=pa.int32())]
+ expected = pa.array([[1, None, None], [2, 5, None], [
+ None, 6, 9]], type=pa.list_(pa.int32()))
+ result = pa.compute.adjoin_as_list(arrs[0], arrs[1], arrs[2])
+ assert result.equals(expected)
+
+ result = pa.compute.adjoin_as_list(
+ arrs[0], arrs[1], arrs[2], list_type="list")
+ assert result.equals(expected)
+
+ expected = pa.array([[1, None, None], [2, 5, None], [
+ None, 6, 9]], type=pa.large_list(pa.int32()))
+ result = pa.compute.adjoin_as_list(
+ arrs[0], arrs[1], arrs[2], list_type="large_list")
+ assert result.equals(expected)
Review Comment:
I wanted to test for fixed_size_list too, but there is no
`pa.fixed_size_list` somehow. Is it intentionally skipped?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]