Skip to content

Commit b9a0795

Browse files
committed
BUG: GH38801 avoid attribute error with pyarrow >=0.16.0 and <1.0.0
update pyarrow Update ci/deps/actions-37-locale.yaml Co-authored-by: Joris Van den Bossche <[email protected]> fixup fixup
1 parent f58d815 commit b9a0795

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

ci/deps/actions-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies:
3030
- openpyxl
3131
- pandas-gbq
3232
- google-cloud-bigquery>=1.27.2 # GH 36436
33-
- pyarrow>=0.17
33+
- pyarrow=0.17 # GH 38803
3434
- pytables>=3.5.1
3535
- scipy
3636
- xarray=0.12.3

pandas/core/arrays/string_arrow.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@
2929
except ImportError:
3030
pa = None
3131
else:
32-
# our min supported version of pyarrow, 0.15.1, does not have a compute
33-
# module
34-
try:
32+
# PyArrow backed StringArrays are available starting at 1.0.0, but this
33+
# file is imported from even if pyarrow is < 1.0.0, before pyarrow.compute
34+
# and its compute functions existed. GH38801
35+
if LooseVersion(pa.__version__) >= "1.0.0":
3536
import pyarrow.compute as pc
36-
except ImportError:
37-
pass
38-
else:
37+
3938
ARROW_CMP_FUNCS = {
4039
"eq": pc.equal,
4140
"ne": pc.not_equal,

pandas/tests/io/test_parquet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ def test_timezone_aware_index(self, pa, timezone_aware_date_list):
896896
# this use-case sets the resolution to 1 minute
897897
check_round_trip(df, pa, check_dtype=False)
898898

899-
@td.skip_if_no("pyarrow", min_version="0.17")
899+
@td.skip_if_no("pyarrow", min_version="1.0.0")
900900
def test_filter_row_groups(self, pa):
901901
# https://github.com/pandas-dev/pandas/issues/26551
902902
df = pd.DataFrame({"a": list(range(0, 3))})

0 commit comments

Comments
 (0)