-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
BugDependenciesRequired and optional dependenciesRequired and optional dependenciesNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
# reproducing involves running this test with numexpr versions 2.13.0 where it passes
# and version 2.13.1 where it fails due to the warning not being issued. There are 5 failing tests in total
def test_add_list_to_masked_array_boolean(self, request):
# GH#22962
warning = (
UserWarning
if request.node.callspec.id == "numexpr" and NUMEXPR_INSTALLED
else None
)
ser = Series([True, None, False], dtype="boolean")
msg = "operator is not supported by numexpr for the bool dtype"
with tm.assert_produces_warning(warning, match=msg):
result = ser + [True, None, True]
expected = Series([True, None, True], dtype="boolean")
tm.assert_series_equal(result, expected)
Issue Description
As of numexpr
version 2.13.1
, we have failing tests in
pandas/tests/frame/test_arithmetic.py
pandas/tests/series/test_arithmetic.py
pandas/tests/test_expressions.py
All are related to warnings no longer being emitted when adding and multiplying bools.
Expected Behavior
def test_add_list_to_masked_array_boolean(self, request):
ser = Series([True, None, False], dtype="boolean")
with tm.assert_produces_warning(None):
result = ser + [True, None, True]
expected = Series([True, None, True], dtype="boolean")
tm.assert_series_equal(result, expected)
test_add_list_to_masked_array_boolean()
Installed Versions
Replace this line with the output of pd.show_versions()
Metadata
Metadata
Assignees
Labels
BugDependenciesRequired and optional dependenciesRequired and optional dependenciesNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations