You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/21 11:50:38 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #14181: ARROW-15479 : [C++] Cast fixed size list to compatible fixed size list type (other values type, other field name)

lidavidm commented on code in PR #14181:
URL: https://github.com/apache/arrow/pull/14181#discussion_r976406545


##########
python/pyarrow/tests/test_compute.py:
##########
@@ -1731,6 +1731,22 @@ def test_cast():
     assert pc.cast(arr, expected.type) == expected
 
 
+def test_fsl_to_fsl_cast():
+    for value_type in (pa.bool_(), pa.float32(), pa.int64()):
+        # Valid case
+        # Different field name and different type.
+        cast_type = pa.list_(pa.field("element", value_type), 2)
+        fsl = pa.FixedSizeListArray.from_arrays(
+            pa.array([1, 2, 3, 4, 5, 6]), 2)

Review Comment:
   It would be good to test with nulls as well, both at the list level and the child array level



##########
python/pyarrow/tests/test_compute.py:
##########
@@ -1731,6 +1731,22 @@ def test_cast():
     assert pc.cast(arr, expected.type) == expected
 
 
+def test_fsl_to_fsl_cast():
+    for value_type in (pa.bool_(), pa.float32(), pa.int64()):
+        # Valid case
+        # Different field name and different type.
+        cast_type = pa.list_(pa.field("element", value_type), 2)
+        fsl = pa.FixedSizeListArray.from_arrays(
+            pa.array([1, 2, 3, 4, 5, 6]), 2)

Review Comment:
   specify the type of the source array explicitly here?



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

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