Skip to content

CI: catch warnings in ci #51515

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

Closed
wants to merge 3 commits into from
Closed
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: 3 additions & 1 deletion pandas/tests/frame/test_query_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,9 @@ def test_query_ea_dtypes(self, dtype):
# GH#50261
df = DataFrame({"a": Series([1, 2], dtype=dtype)})
ref = {2} # noqa:F841
result = df.query("a in @ref")
warning = RuntimeWarning if dtype == "Int64" and NUMEXPR_INSTALLED else None
with tm.assert_produces_warning(warning):
result = df.query("a in @ref")
expected = DataFrame({"a": Series([2], dtype=dtype, index=[1])})
tm.assert_frame_equal(result, expected)

Expand Down
15 changes: 12 additions & 3 deletions pandas/tests/series/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
ops,
)
from pandas.core.computation import expressions as expr
from pandas.core.computation.check import NUMEXPR_INSTALLED


@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
def switch_numexpr_min_elements(request):
_MIN_ELEMENTS = expr._MIN_ELEMENTS
expr._MIN_ELEMENTS = request.param
print("hello")
yield request.param
expr._MIN_ELEMENTS = _MIN_ELEMENTS

Expand Down Expand Up @@ -349,14 +351,21 @@ def test_add_list_to_masked_array(self, val, dtype):
result = [1, None, val] + ser
tm.assert_series_equal(result, expected)

def test_add_list_to_masked_array_boolean(self):
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")
result = ser + [True, None, True]
with tm.assert_produces_warning(warning):
result = ser + [True, None, True]
expected = Series([True, None, True], dtype="boolean")
tm.assert_series_equal(result, expected)

result = [True, None, True] + ser
with tm.assert_produces_warning(warning):
result = [True, None, True] + ser
tm.assert_series_equal(result, expected)


Expand Down