diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index 8709559cdfa6b..e092d65f08dd4 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -7,7 +7,6 @@ from typing import ( TYPE_CHECKING, ContextManager, - cast, ) import numpy as np @@ -512,9 +511,6 @@ def shares_memory(left, right) -> bool: if isinstance(left, ArrowExtensionArray): if isinstance(right, ArrowExtensionArray): # https://github.com/pandas-dev/pandas/pull/43930#discussion_r736862669 - # breakpoint() - left = cast("ArrowExtensionArray", left) - right = cast("ArrowExtensionArray", right) left_pa_data = left._pa_array right_pa_data = right._pa_array left_buf1 = left_pa_data.chunk(0).buffers()[1] diff --git a/pandas/tests/copy_view/test_astype.py b/pandas/tests/copy_view/test_astype.py index 0c782420a5b45..91f5badeb9728 100644 --- a/pandas/tests/copy_view/test_astype.py +++ b/pandas/tests/copy_view/test_astype.py @@ -3,6 +3,7 @@ import numpy as np import pytest +from pandas.compat import HAS_PYARROW from pandas.compat.pyarrow import pa_version_under12p0 from pandas import ( @@ -223,7 +224,7 @@ def test_convert_dtypes(using_infer_string): df_orig = df.copy() df2 = df.convert_dtypes() - if using_infer_string: + if using_infer_string and HAS_PYARROW: # TODO the default nullable string dtype still uses python storage # this should be changed to pyarrow if installed assert not tm.shares_memory(get_array(df2, "a"), get_array(df, "a"))