Skip to content

Commit 77f171d

Browse files
committed
update warning message
1 parent b03eadd commit 77f171d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/source/whatsnew/v0.25.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ Deprecations
264264
- The :meth:`DataFrame.compound` and :meth:`Series.compound` methods are deprecated and will be removed in a future version.
265265
- The default value ``ordered=None`` in :class:`~pandas.api.types.CategoricalDtype` has been deprecated in favor of ``ordered=False``. When converting between categorical types ``ordered=True`` must be explicitly passed in order to be preserved. (:issue:`26336`)
266266

267+
267268
.. _whatsnew_0250.prior_deprecations:
268269

269270
Removal of prior version deprecations/changes

pandas/core/dtypes/dtypes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,10 @@ def update_dtype(self, dtype):
543543
if new_ordered is None:
544544
new_ordered = self.ordered
545545
if self.ordered:
546-
msg = ("ordered=None is deprecated and will default to False "
547-
"in a future version; ordered=True must be explicitly "
546+
msg = ("Constructing a CategoricalDtype without specifying "
547+
"`ordered` or explicitly passing `ordered=None` is "
548+
"deprecated and will default to `ordered=False` in a "
549+
"future version; `ordered=True` must be explicitly "
548550
"passed in order to be retained")
549551
warnings.warn(msg, FutureWarning, stacklevel=3)
550552

0 commit comments

Comments
 (0)