@@ -960,7 +960,7 @@ def test_infer_objects(using_copy_on_write, using_infer_string):
960
960
961
961
if using_copy_on_write :
962
962
assert np .shares_memory (get_array (df2 , "a" ), get_array (df , "a" ))
963
- if using_infer_string and HAS_PYARROW :
963
+ if using_infer_string :
964
964
assert not tm .shares_memory (get_array (df2 , "b" ), get_array (df , "b" ))
965
965
else :
966
966
assert np .shares_memory (get_array (df2 , "b" ), get_array (df , "b" ))
@@ -1000,7 +1000,7 @@ def test_infer_objects_no_reference(using_copy_on_write, using_infer_string):
1000
1000
df .iloc [0 , 3 ] = Timestamp ("2018-12-31" )
1001
1001
if using_copy_on_write :
1002
1002
assert np .shares_memory (arr_a , get_array (df , "a" ))
1003
- if using_infer_string and HAS_PYARROW :
1003
+ if using_infer_string :
1004
1004
# note that the underlying memory of arr_b has been copied anyway
1005
1005
# because of the assignment, but the EA is updated inplace so still
1006
1006
# appears the share memory
@@ -1011,7 +1011,7 @@ def test_infer_objects_no_reference(using_copy_on_write, using_infer_string):
1011
1011
assert np .shares_memory (arr_d , get_array (df , "d" ))
1012
1012
1013
1013
1014
- def test_infer_objects_reference (using_copy_on_write ):
1014
+ def test_infer_objects_reference (using_copy_on_write , using_infer_string ):
1015
1015
df = DataFrame (
1016
1016
{
1017
1017
"a" : [1 , 2 ],
@@ -1034,7 +1034,8 @@ def test_infer_objects_reference(using_copy_on_write):
1034
1034
df .iloc [0 , 3 ] = Timestamp ("2018-12-31" )
1035
1035
if using_copy_on_write :
1036
1036
assert not np .shares_memory (arr_a , get_array (df , "a" ))
1037
- assert not np .shares_memory (arr_b , get_array (df , "b" ))
1037
+ if not using_infer_string or HAS_PYARROW :
1038
+ assert not np .shares_memory (arr_b , get_array (df , "b" ))
1038
1039
assert np .shares_memory (arr_d , get_array (df , "d" ))
1039
1040
1040
1041
0 commit comments