diff --git a/ci/deps/actions-37-locale.yaml b/ci/deps/actions-37-locale.yaml index 4f9918ca2f0c0..b18ce37d05ca0 100644 --- a/ci/deps/actions-37-locale.yaml +++ b/ci/deps/actions-37-locale.yaml @@ -30,7 +30,7 @@ dependencies: - openpyxl - pandas-gbq - google-cloud-bigquery>=1.27.2 # GH 36436 - - pyarrow>=0.17 + - pyarrow=0.17 # GH 38803 - pytables>=3.5.1 - scipy - xarray=0.12.3 diff --git a/doc/source/whatsnew/v1.2.1.rst b/doc/source/whatsnew/v1.2.1.rst index e9602bbe1cee1..5695c817b5a3a 100644 --- a/doc/source/whatsnew/v1.2.1.rst +++ b/doc/source/whatsnew/v1.2.1.rst @@ -37,6 +37,7 @@ I/O - Bumped minimum fastparquet version to 0.4.0 to avoid ``AttributeError`` from numba (:issue:`38344`) - Bumped minimum pymysql version to 0.8.1 to avoid test failures (:issue:`38344`) +- Fixed ``AttributeError`` with PyArrow versions [0.16.0, 1.0.0) (:issue:`38801`) - - diff --git a/pandas/core/arrays/string_arrow.py b/pandas/core/arrays/string_arrow.py index 184fbc050036b..7d3806fe11bd2 100644 --- a/pandas/core/arrays/string_arrow.py +++ b/pandas/core/arrays/string_arrow.py @@ -29,13 +29,12 @@ except ImportError: pa = None else: - # our min supported version of pyarrow, 0.15.1, does not have a compute - # module - try: + # PyArrow backed StringArrays are available starting at 1.0.0, but this + # file is imported from even if pyarrow is < 1.0.0, before pyarrow.compute + # and its compute functions existed. GH38801 + if LooseVersion(pa.__version__) >= "1.0.0": import pyarrow.compute as pc - except ImportError: - pass - else: + ARROW_CMP_FUNCS = { "eq": pc.equal, "ne": pc.not_equal, diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 99e7c3061d670..a9357ef89de92 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -880,7 +880,7 @@ def test_timezone_aware_index(self, pa, timezone_aware_date_list): # this use-case sets the resolution to 1 minute check_round_trip(df, pa, check_dtype=False) - @td.skip_if_no("pyarrow", min_version="0.17") + @td.skip_if_no("pyarrow", min_version="1.0.0") def test_filter_row_groups(self, pa): # https://github.com/pandas-dev/pandas/issues/26551 df = pd.DataFrame({"a": list(range(0, 3))})