ritchie46 commented on a change in pull request #9778:
URL: https://github.com/apache/arrow/pull/9778#discussion_r603309366



##########
File path: rust/arrow-pyarrow-integration-testing/tests/test_sql.py
##########
@@ -78,3 +78,23 @@ def test_time32_python(self):
         del expected
         # No leak of C++ memory
         self.assertEqual(old_allocated, pyarrow.total_allocated_bytes())
+
+    def test_list_array(self):
+        """
+        Python -> Rust -> Python
+        """
+        old_allocated = pyarrow.total_allocated_bytes()
+        a = pyarrow.array([[1, 2], [1, 2]], pyarrow.list_(pyarrow.int64()))
+        b = arrow_pyarrow_integration_testing.round_trip(a)
+        # list equality does not work, so we check the elements

Review comment:
       
   > As a first step, can you add the following code:
   > 
   > ```python
   > b.validate(full=True)
   > assert a.to_pylist() == b.to_pylist()
   > ```
   > 
   > Also, you should make the example slightly more "interesting", instead of 
`[[1, 2], [1, 2]]` use e.g. `[[], None, [1, 2], [4, 5, 6]]`.
   
   
   I did add those test you recommended. They run successfully. What does fail, 
is testing equality with `a == b`. Which I assume is due to the difference in 
the type `is_nullable` flag.
   
   

##########
File path: rust/arrow-pyarrow-integration-testing/tests/test_sql.py
##########
@@ -78,3 +78,23 @@ def test_time32_python(self):
         del expected
         # No leak of C++ memory
         self.assertEqual(old_allocated, pyarrow.total_allocated_bytes())
+
+    def test_list_array(self):
+        """
+        Python -> Rust -> Python
+        """
+        old_allocated = pyarrow.total_allocated_bytes()
+        a = pyarrow.array([[1, 2], [1, 2]], pyarrow.list_(pyarrow.int64()))
+        b = arrow_pyarrow_integration_testing.round_trip(a)
+        # list equality does not work, so we check the elements

Review comment:
       
   > When you say "it did not have an effect on the test", what do you mean 
precisely? The test should certainly succeed.
   
   And what I mean by "it did not have an effect on the test", is that adding 
[the `is_nullable` 
flag](https://github.com/apache/arrow/pull/9778/commits/90d68d89abb2f2606005162199ab13330a909852),
 did not lead to `a == b` evaluating to `True`.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to