Skip to content

Commit 71c4cf1

Browse files
committed
BUG: GH38801 avoid attribute error with pyarrow >=0.16.0 and <1.0.0
update pyarrow
1 parent f58d815 commit 71c4cf1

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
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.0 # GH 38803
3434
- pytables>=3.5.1
3535
- scipy
3636
- xarray=0.12.3

pandas/core/arrays/string_arrow.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,20 @@
3636
except ImportError:
3737
pass
3838
else:
39-
ARROW_CMP_FUNCS = {
40-
"eq": pc.equal,
41-
"ne": pc.not_equal,
42-
"lt": pc.less,
43-
"gt": pc.greater,
44-
"le": pc.less_equal,
45-
"ge": pc.greater_equal,
46-
}
39+
# pyarrow 0.16.0 adds a compute module (thus the above compute import
40+
# will work) but the attributes below are not available until pyarrow
41+
# 1.0.0 resulting in an Attribute Error with pyarrow (0.16.0, 1.0.0].
42+
try:
43+
ARROW_CMP_FUNCS = {
44+
"eq": pc.equal,
45+
"ne": pc.not_equal,
46+
"lt": pc.less,
47+
"gt": pc.greater,
48+
"le": pc.less_equal,
49+
"ge": pc.greater_equal,
50+
}
51+
except AttributeError:
52+
pass
4753

4854

4955
if TYPE_CHECKING:

0 commit comments

Comments
 (0)