Skip to content

Commit

Permalink
Merge branch '2.1.x' into auto-backport-of-pr-55189-on-2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Sep 20, 2023
2 parents 488face + 652fd13 commit eb3e2fa
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
- gcsfs>=2022.05.0
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
- numba>=0.55.2
- numexpr>=2.8.0
- odfpy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-311-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies:
- gcsfs>=2022.05.0
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
- numba>=0.55.2
- numexpr>=2.8.0
- odfpy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
- gcsfs>=2022.05.0
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
- numba>=0.55.2
- numexpr>=2.8.0
- odfpy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
- gcsfs>=2022.05.0
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
- numba>=0.55.2
- numexpr>=2.8.0
- odfpy>=1.4.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/circle-310-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
- gcsfs>=2022.05.0
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
# test_numba_vs_cython segfaults with numba 0.57
- numba>=0.55.2, <0.57.0
- numexpr>=2.8.0
Expand Down
3 changes: 2 additions & 1 deletion doc/source/whatsnew/v2.1.1.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _whatsnew_211:

What's new in 2.1.1 (September XX, 2023)
What's new in 2.1.1 (September 20, 2023)
----------------------------------------

These are the changes in pandas 2.1.1. See :ref:`release` for a full changelog
Expand All @@ -26,6 +26,7 @@ Fixed regressions
- Fixed regression in :meth:`Series.drop_duplicates` for PyArrow strings (:issue:`54904`)
- Fixed regression in :meth:`Series.interpolate` raising when ``fill_value`` was given (:issue:`54920`)
- Fixed regression in :meth:`Series.value_counts` raising for numeric data if ``bins`` was specified (:issue:`54857`)
- Fixed regression in comparison operations for PyArrow backed columns not propagating exceptions correctly (:issue:`54944`)
- Fixed regression when comparing a :class:`Series` with ``datetime64`` dtype with ``None`` (:issue:`54870`)

.. ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies:
- ipython
- jinja2>=3.1.2
- lxml>=4.8.0
- matplotlib>=3.6.1
- matplotlib>=3.6.1, <3.8
- numba>=0.55.2
- numexpr>=2.8.0
- openpyxl>=3.0.10
Expand Down
16 changes: 9 additions & 7 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,20 +627,22 @@ def __setstate__(self, state) -> None:

def _cmp_method(self, other, op):
pc_func = ARROW_CMP_FUNCS[op.__name__]
try:
if isinstance(other, (ArrowExtensionArray, np.ndarray, list, BaseMaskedArray)):
result = pc_func(self._pa_array, self._box_pa(other))
except (pa.lib.ArrowNotImplementedError, pa.lib.ArrowInvalid):
if is_scalar(other):
elif is_scalar(other):
try:
result = pc_func(self._pa_array, self._box_pa(other))
except (pa.lib.ArrowNotImplementedError, pa.lib.ArrowInvalid):
mask = isna(self) | isna(other)
valid = ~mask
result = np.zeros(len(self), dtype="bool")
result[valid] = op(np.array(self)[valid], other)
result = pa.array(result, type=pa.bool_())
result = pc.if_else(valid, result, None)
else:
raise NotImplementedError(
f"{op.__name__} not implemented for {type(other)}"
)
else:
raise NotImplementedError(
f"{op.__name__} not implemented for {type(other)}"
)
return ArrowExtensionArray(result)

def _evaluate_op_method(self, other, op, arrow_funcs):
Expand Down
8 changes: 8 additions & 0 deletions pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3072,6 +3072,14 @@ def test_duration_fillna_numpy(pa_type):
tm.assert_series_equal(result, expected)


def test_comparison_not_propagating_arrow_error():
# GH#54944
a = pd.Series([1 << 63], dtype="uint64[pyarrow]")
b = pd.Series([None], dtype="int64[pyarrow]")
with pytest.raises(pa.lib.ArrowInvalid, match="Integer value"):
a < b


def test_factorize_chunked_dictionary():
# GH 54844
pa_array = pa.chunked_array(
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gcsfs>=2022.05.0
ipython
jinja2>=3.1.2
lxml>=4.8.0
matplotlib>=3.6.1
matplotlib>=3.6.1, <3.8
numba>=0.55.2
numexpr>=2.8.0
openpyxl>=3.0.10
Expand Down

0 comments on commit eb3e2fa

Please sign in to comment.