Skip to content

Commit 5d0f9a8

Browse files
authored
CI: Fix ci for numpy 2 failures (#59545)
1 parent a7a1410 commit 5d0f9a8

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
@@ -546,7 +546,7 @@ def _maybe_right_yaxis(self, ax: Axes, axes_num: int) -> Axes:
546546
new_ax.set_yscale("log")
547547
elif self.logy == "sym" or self.loglog == "sym":
548548
new_ax.set_yscale("symlog")
549-
return new_ax # type: ignore[return-value]
549+
return new_ax
550550

551551
@final
552552
@cache_readonly

pandas/tests/io/test_parquet.py

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

1181+
@pytest.mark.xfail(
1182+
Version(np.__version__) >= Version("2.0.0"),
1183+
reason="fastparquet uses np.float_ in numpy2",
1184+
)
11811185
def test_bool_with_none(self, fp):
11821186
df = pd.DataFrame({"a": [True, None, False]})
11831187
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
@@ -45,6 +45,7 @@
4545
_check_visible,
4646
get_y_axis,
4747
)
48+
from pandas.util.version import Version
4849

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

@@ -2465,8 +2466,14 @@ def test_group_subplot_invalid_column_name(self):
24652466
d = {"a": np.arange(10), "b": np.arange(10)}
24662467
df = DataFrame(d)
24672468

2468-
with pytest.raises(ValueError, match=r"Column label\(s\) \['bad_name'\]"):
2469-
df.plot(subplots=[("a", "bad_name")])
2469+
if Version(np.__version__) < Version("2.0.0"):
2470+
with pytest.raises(ValueError, match=r"Column label\(s\) \['bad_name'\]"):
2471+
df.plot(subplots=[("a", "bad_name")])
2472+
else:
2473+
with pytest.raises(
2474+
ValueError, match=r"Column label\(s\) \[np\.str\_\('bad_name'\)\]"
2475+
):
2476+
df.plot(subplots=[("a", "bad_name")])
24702477

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

0 commit comments

Comments
 (0)