uros-b commented on code in PR #50561:
URL: https://github.com/apache/arrow/pull/50561#discussion_r3658703125


##########
python/pyarrow/tests/test_table.py:
##########
@@ -144,6 +144,16 @@ def test_chunked_array_to_numpy():
     assert np.array_equal(arr1, arr2)
 
 
[email protected]
+def test_chunked_array_array_copy_true_is_writable():
+    data = pa.chunked_array([[1, 2, 3]])
+    result = data.__array__(copy=True)
+
+    assert result.flags.writeable
+    result[0] = 99
+    assert result.tolist() == [99, 2, 3]
+

Review Comment:
   The fix added `dtype=dtype` handling to this code path, but the new test 
only exercises `copy=True` (with no dtype). For example, the Array counterpart 
tests both - asserting `result.dtype == "float64"`). Please consider adding a 
new test case (or extending this one) with simple assert to cover all the bases.
   
   e.g.
   ```
       result = data.__array__(dtype=np.dtype("float64"), copy=True)
       assert result.dtype == "float64"
       assert result.flags.writeable
   ```



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