From 0d4d8c331324d38104a0a3faeb084ff19b61ab5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Kothe?= Date: Wed, 17 Sep 2025 13:00:53 -0300 Subject: [PATCH] fix(series): improve future warning This change makes the warning more explicit about data types, where it clearly states that are talking about boolean numpy backend or object dtype. Also clearly states that it returns a numpy boolean series. --- pandas/core/series.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index cc16c29c6c861..aa342c4829f78 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -6161,9 +6161,11 @@ def _align_for_op(self, right, align_asobject: bool = False): np.bool_, ): warnings.warn( - "Operation between non boolean Series with different " - "indexes will no longer return a boolean result in " - "a future version. Cast both Series to object type " + "Operation between Series with different indexes " + "that are not of numpy boolean or object dtype " + "will no longer return a numpy boolean result " + "in a future version. " + "Cast both Series to object type " "to maintain the prior behavior.", FutureWarning, stacklevel=find_stack_level(),