Skip to content

Commit 96cedab

Browse files
Backport PR pandas-dev#41730: CI: suppress npdev warnings (pandas-dev#41762)
1 parent 03d6b03 commit 96cedab

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

ci/azure/posix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
ENV_FILE: ci/deps/azure-38-numpydev.yaml
6363
CONDA_PY: "38"
6464
PATTERN: "not slow and not network"
65-
TEST_ARGS: "-W error"
65+
TEST_ARGS: "-W error -W \"ignore:Promotion of numbers and bools:FutureWarning\""
6666
PANDAS_TESTING_MODE: "deprecate"
6767
EXTRA_APT: "xsel"
6868

pandas/tests/arithmetic/common.py

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def xbox2(x):
8383
"Invalid comparison between",
8484
"Cannot compare type",
8585
"not supported between",
86+
"could not be promoted",
8687
"invalid type promotion",
8788
(
8889
# GH#36706 npdev 1.20.0 2020-09-28

pandas/tests/arithmetic/test_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_compare_list_like_nan(self, op, array, nulls_fixture, request):
235235
Categorical(list("abab")),
236236
Categorical(date_range("2017-01-01", periods=4)),
237237
pd.array(list("abcd")),
238-
pd.array(["foo", 3.14, None, object()]),
238+
pd.array(["foo", 3.14, None, object()], dtype=object),
239239
],
240240
ids=lambda x: str(x.dtype),
241241
)

pandas/tests/frame/methods/test_to_records.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat.numpy import is_numpy_dev
7+
68
from pandas import (
79
CategoricalDtype,
810
DataFrame,
@@ -162,20 +164,28 @@ def test_to_records_with_categorical(self):
162164
),
163165
),
164166
# Pass in a type instance.
165-
(
167+
pytest.param(
166168
{"column_dtypes": str},
167169
np.rec.array(
168170
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
169171
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
170172
),
173+
marks=pytest.mark.xfail(
174+
is_numpy_dev,
175+
reason="https://github.com/numpy/numpy/issues/19078",
176+
),
171177
),
172178
# Pass in a dtype instance.
173-
(
179+
pytest.param(
174180
{"column_dtypes": np.dtype("unicode")},
175181
np.rec.array(
176182
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
177183
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
178184
),
185+
marks=pytest.mark.xfail(
186+
is_numpy_dev,
187+
reason="https://github.com/numpy/numpy/issues/19078",
188+
),
179189
),
180190
# Pass in a dictionary (name-only).
181191
(

pandas/tests/frame/test_arithmetic.py

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def check(df, df2):
7979
msgs = [
8080
r"Invalid comparison between dtype=datetime64\[ns\] and ndarray",
8181
"invalid type promotion",
82+
"could not be promoted",
8283
(
8384
# npdev 1.20.0
8485
r"The DTypes <class 'numpy.dtype\[.*\]'> and "

0 commit comments

Comments
 (0)