From a336b09d4ad04333a82b5cf24806888943a87fa8 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 16 Mar 2023 02:15:26 -0700 Subject: [PATCH] Backport PR #52010: DEPS: Filter numpy's FutureWarning from array_equal --- pandas/core/dtypes/cast.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 6c1feded35b5b..c7fc71104442c 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1610,6 +1610,9 @@ def maybe_cast_to_integer_array(arr: list | np.ndarray, dtype: np.dtype) -> np.n with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=RuntimeWarning) + warnings.filterwarnings( + "ignore", "elementwise comparison failed", FutureWarning + ) if np.array_equal(arr, casted): return casted