Skip to content

Commit 71ad173

Browse files
Backport PR #59545 on branch 2.2.x (CI: Fix ci for numpy 2 failures) (#59550)
Backport PR #59545: CI: Fix ci for numpy 2 failures Co-authored-by: Patrick Hoefler <[email protected]>
1 parent 795cce2 commit 71ad173

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

pandas/plotting/_matplotlib/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def _maybe_right_yaxis(self, ax: Axes, axes_num: int) -> Axes:
547547
new_ax.set_yscale("log")
548548
elif self.logy == "sym" or self.loglog == "sym":
549549
new_ax.set_yscale("symlog")
550-
return new_ax # type: ignore[return-value]
550+
return new_ax
551551

552552
@final
553553
@cache_readonly

pandas/tests/io/test_parquet.py

+4
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,10 @@ def test_duplicate_columns(self, fp):
11951195
msg = "Cannot create parquet dataset with duplicate column names"
11961196
self.check_error_on_write(df, fp, ValueError, msg)
11971197

1198+
@pytest.mark.xfail(
1199+
Version(np.__version__) >= Version("2.0.0"),
1200+
reason="fastparquet uses np.float_ in numpy2",
1201+
)
11981202
def test_bool_with_none(self, fp):
11991203
df = pd.DataFrame({"a": [True, None, False]})
12001204
expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16")

pandas/tests/plotting/frame/test_frame.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
_check_visible,
4545
get_y_axis,
4646
)
47+
from pandas.util.version import Version
4748

4849
from pandas.io.formats.printing import pprint_thing
4950

@@ -2487,8 +2488,14 @@ def test_group_subplot_invalid_column_name(self):
24872488
d = {"a": np.arange(10), "b": np.arange(10)}
24882489
df = DataFrame(d)
24892490

2490-
with pytest.raises(ValueError, match=r"Column label\(s\) \['bad_name'\]"):
2491-
df.plot(subplots=[("a", "bad_name")])
2491+
if Version(np.__version__) < Version("2.0.0"):
2492+
with pytest.raises(ValueError, match=r"Column label\(s\) \['bad_name'\]"):
2493+
df.plot(subplots=[("a", "bad_name")])
2494+
else:
2495+
with pytest.raises(
2496+
ValueError, match=r"Column label\(s\) \[np\.str\_\('bad_name'\)\]"
2497+
):
2498+
df.plot(subplots=[("a", "bad_name")])
24922499

24932500
def test_group_subplot_duplicated_column(self):
24942501
d = {"a": np.arange(10), "b": np.arange(10), "c": np.arange(10)}

0 commit comments

Comments
 (0)