diff --git a/pandas/io/date_converters.py b/pandas/io/date_converters.py index 5885a3b9d14d7..99a838c61b996 100644 --- a/pandas/io/date_converters.py +++ b/pandas/io/date_converters.py @@ -92,9 +92,7 @@ def generic_parser(parse_func, *cols) -> np.ndarray: """ warnings.warn( - """ - Use pd.to_datetime instead. -""", + "Use pd.to_datetime instead.", FutureWarning, stacklevel=find_stack_level(inspect.currentframe()), ) diff --git a/pandas/tests/frame/methods/test_fillna.py b/pandas/tests/frame/methods/test_fillna.py index 4cf6706707569..3d7e5c6823e9d 100644 --- a/pandas/tests/frame/methods/test_fillna.py +++ b/pandas/tests/frame/methods/test_fillna.py @@ -777,6 +777,6 @@ def test_fillna_nonconsolidated_frame(): ], columns=["i1", "i2", "i3", "f1"], ) - df_nonconsol = df.pivot("i1", "i2") + df_nonconsol = df.pivot(index="i1", columns="i2") result = df_nonconsol.fillna(0) assert result.isna().sum().sum() == 0 diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index f804f7df06bb8..b64af2dd98bcb 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -70,7 +70,8 @@ def test_plot(self): ax = _check_plot_works(df.plot, use_index=True) self._check_ticks_props(ax, xrot=0) - _check_plot_works(df.plot, sort_columns=False) + with tm.assert_produces_warning(FutureWarning, check_stacklevel=False): + _check_plot_works(df.plot, sort_columns=False) _check_plot_works(df.plot, yticks=[1, 5, 10]) _check_plot_works(df.plot, xticks=[1, 5, 10]) _check_plot_works(df.plot, ylim=(-100, 100), xlim=(-100, 100))