File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -6456,12 +6456,16 @@ def astype(
64566456 else :
64576457 # else, only a single dtype is given
64586458
6459- # GH 61074: Make dtype="category" imply "ordered" = False + add deprecation warning
6459+ # GH 61074: Make dtype="category" imply "ordered" = False
6460+ # and add a deprecation warning
64606461 if dtype == "category" :
64616462 if isinstance (self .dtype , CategoricalDtype ):
64626463 if self .dtype .ordered :
64636464 warnings .warn (
6464- "The 'category' dtype is being set to ordered=False by default." ,
6465+ (
6466+ "The 'category' dtype is being set to ordered=False "
6467+ " by default."
6468+ ),
64656469 DeprecationWarning ,
64666470 stacklevel = find_stack_level (),
64676471 )
Original file line number Diff line number Diff line change @@ -610,8 +610,12 @@ def test_astype_categoricaldtype(self):
610610 def test_astype_categorical_to_categorical (
611611 self , name , dtype_ordered , series_ordered
612612 ):
613+ # GH 61074
613614 def check_deprecation_warning (series ):
614- """Helper function to check DeprecationWarning for ordered = True conversions"""
615+ """
616+ Helper function to check DeprecationWarning
617+ for ordered = True conversions
618+ """
615619 msg = "The 'category' dtype is being set to ordered=False by default."
616620 with tm .assert_produces_warning (DeprecationWarning , match = msg ):
617621 result = series .astype ("category" )
You can’t perform that action at this time.
0 commit comments