Skip to content

Commit

Permalink
WARN: Improve deprecation message (#56541)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Dec 17, 2023
1 parent 9a08863 commit 86488f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down

0 comments on commit 86488f7

Please sign in to comment.