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


##########
cpp/src/arrow/compute/kernels/scalar_cast_test.cc:
##########
@@ -2209,6 +2209,39 @@ TEST(Cast, ListToListOptionsPassthru) {
   }
 }
 
+static void CheckFSLToFSL(const std::vector<std::shared_ptr<DataType>>& 
value_types,
+                          const std::string& json_data) {
+  for (const auto& src_value_type : value_types) {
+    for (const auto& dest_value_type : value_types) {
+      const auto src_type = fixed_size_list(src_value_type, 2);
+      const auto dest_type = fixed_size_list(dest_value_type, 2);
+      ARROW_SCOPED_TRACE("src_type = ", src_type->ToString(),
+                         ", dest_type = ", dest_type->ToString());
+      auto src_array = ArrayFromJSON(src_type, json_data);
+      auto dst_array = ArrayFromJSON(dest_type, json_data);
+      CheckCast(src_array, dst_array);
+    }
+  }
+}
+
+TEST(Cast, FSLToFSL) {
+  CheckFSLToFSL({int32(), float32(), int64()}, "[[0, 1], [2, 3], [null, 5]]");

Review Comment:
   ```suggestion
     CheckFSLToFSL({int32(), float32(), int64()}, "[[0, 1], [2, 3], [null, 5], 
null]");
   ```



##########
cpp/src/arrow/compute/kernels/scalar_cast_test.cc:
##########
@@ -2209,6 +2209,39 @@ TEST(Cast, ListToListOptionsPassthru) {
   }
 }
 
+static void CheckFSLToFSL(const std::vector<std::shared_ptr<DataType>>& 
value_types,
+                          const std::string& json_data) {
+  for (const auto& src_value_type : value_types) {
+    for (const auto& dest_value_type : value_types) {
+      const auto src_type = fixed_size_list(src_value_type, 2);
+      const auto dest_type = fixed_size_list(dest_value_type, 2);
+      ARROW_SCOPED_TRACE("src_type = ", src_type->ToString(),
+                         ", dest_type = ", dest_type->ToString());
+      auto src_array = ArrayFromJSON(src_type, json_data);
+      auto dst_array = ArrayFromJSON(dest_type, json_data);
+      CheckCast(src_array, dst_array);
+    }
+  }
+}
+
+TEST(Cast, FSLToFSL) {
+  CheckFSLToFSL({int32(), float32(), int64()}, "[[0, 1], [2, 3], [null, 5]]");
+}

Review Comment:
   Maybe also just `CheckCastFails(...)` to test what happens with a different 
type in C++? (A lot of development doesn't run the Python tests, so it's faster 
to catch things in C++ where possible.)



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

Reply via email to