Skip to content

TST: fix xfails/skips #44706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/computation/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def _evaluate_numexpr(op, op_str, a, b):
roperator.rfloordiv: None,
# we require Python semantics for mod of negative for backwards compatibility
# see https://github.com/pydata/numexpr/issues/365
# so sticking with unaccelerated for now
# so sticking with unaccelerated for now GH#36552
operator.mod: None,
roperator.rmod: "%",
roperator.rmod: None,
operator.pow: "**",
roperator.rpow: "**",
operator.eq: "==",
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/scalar/timedelta/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@ def test_compare_td64_ndarray(self):
result = arr != td
tm.assert_numpy_array_equal(result, ~expected)

@pytest.mark.skip(reason="GH#20829 is reverted until after 0.24.0")
def test_compare_custom_object(self):
"""
Make sure non supported operations on Timedelta returns NonImplemented
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def test_frame_series_axis(self, axis, arith):
"op",
[
"__mod__",
pytest.param("__rmod__", marks=pytest.mark.xfail(reason="GH-36552")),
"__rmod__",
"__floordiv__",
"__rfloordiv__",
],
Expand Down
10 changes: 9 additions & 1 deletion pandas/tests/test_nanops.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ def check_fun_data(
else:
targ = targfunc(targartempval, axis=axis, **kwargs)

if targartempval.dtype == object and (
targfunc is np.any or targfunc is np.all
):
# GH#12863 the numpy functions will retain e.g. floatiness
if isinstance(targ, np.ndarray):
targ = targ.astype(bool)
else:
targ = bool(targ)

res = testfunc(testarval, axis=axis, skipna=skipna, **kwargs)
self.check_results(targ, res, axis, check_dtype=check_dtype)
if skipna:
Expand Down Expand Up @@ -270,7 +279,6 @@ def _badobj_wrap(self, value, func, allow_complex=True, **kwargs):
value = value.astype("f8")
return func(value, **kwargs)

@pytest.mark.xfail(reason="GH12863: numpy result won't match for object type")
@pytest.mark.parametrize(
"nan_op,np_op", [(nanops.nanany, np.any), (nanops.nanall, np.all)]
)
Expand Down