From 86488f700ead42d75dae169032a010c6058e0602 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Mon, 18 Dec 2023 00:14:06 +0100 Subject: [PATCH] WARN: Improve deprecation message (#56541) --- pandas/core/frame.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b63929079abeb..e9b735d389791 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -5227,8 +5227,9 @@ def _sanitize_column(self, value) -> tuple[ArrayLike, BlockValuesRefs | None]: # TODO: Remove kludge in sanitize_array for string mode when enforcing # this deprecation warnings.warn( - "Setting an Index with object dtype into a DataFrame will no longer " - "infer another dtype. Cast the Index explicitly before setting.", + "Setting an Index with object dtype into a DataFrame will stop " + "inferring another dtype in a future version. Cast the Index " + "explicitly before setting it into the DataFrame.", FutureWarning, stacklevel=find_stack_level(), )