AlenkaF commented on code in PR #49247:
URL: https://github.com/apache/arrow/pull/49247#discussion_r3020552310


##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -2975,7 +2975,9 @@ def check_zero_copy_failure(self, arr):
             arr.to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_object_types(self):
-        self.check_zero_copy_failure(pa.array(['A', 'B', 'C']))
+        if Version(pd.__version__) < Version("3.0.0"):
+            # pandas 3.0 includes default string dtype support

Review Comment:
   OK, got it. This test checks that strings can not be zero copied to Pandas. 
Which has been true in the past as the C++ machinery constructed an object type 
from Pyarrow string type. Now, with pandas 3.0.0 we can move through 
`__from_arrow__` where no copies are needed.
   
   <details>
   <summary>Running this test locally with pandas 3.0.0 gives following 
error:</summary>
   
   ```python
   ______________________________________________ 
TestZeroCopyConversion.test_zero_copy_failure_on_object_types 
_______________________________________________
   
   self = <pyarrow.tests.test_pandas.TestZeroCopyConversion object at 
0x156a0af90>
   
       def test_zero_copy_failure_on_object_types(self):
   >       self.check_zero_copy_failure(pa.array(['A', 'B', 'C']))
   
   python/pyarrow/tests/test_pandas.py:2978: 
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   
   self = <pyarrow.tests.test_pandas.TestZeroCopyConversion object at 
0x156a0af90>
   arr = <pyarrow.lib.StringArray object at 0x15699b700>
   [
     "A",
     "B",
     "C"
   ]
   
       def check_zero_copy_failure(self, arr):
   >       with pytest.raises(pa.ArrowInvalid):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   E       Failed: DID NOT RAISE <class 'pyarrow.lib.ArrowInvalid'>
   
   python/pyarrow/tests/test_pandas.py:2974: Failed
   ```
   </details>



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