@@ -738,7 +738,7 @@ def categories(self):
738738 return self .dtype .categories
739739
740740 @categories .setter
741- def categories (self , categories ):
741+ def categories (self , categories ) -> None :
742742 new_dtype = CategoricalDtype (categories , ordered = self .ordered )
743743 if self .dtype .categories is not None and len (self .dtype .categories ) != len (
744744 new_dtype .categories
@@ -776,7 +776,7 @@ def codes(self) -> np.ndarray:
776776 v .flags .writeable = False
777777 return v
778778
779- def _set_categories (self , categories , fastpath = False ):
779+ def _set_categories (self , categories , fastpath = False ) -> None :
780780 """
781781 Sets new categories inplace
782782
@@ -1700,7 +1700,7 @@ def _internal_get_values(self):
17001700 return self .categories .astype ("object" ).take (self ._codes , fill_value = np .nan )
17011701 return np .array (self )
17021702
1703- def check_for_ordered (self , op ):
1703+ def check_for_ordered (self , op ) -> None :
17041704 """assert that we are ordered"""
17051705 if not self .ordered :
17061706 raise TypeError (
@@ -1931,7 +1931,7 @@ def _codes(self) -> np.ndarray:
19311931 return self ._ndarray
19321932
19331933 @_codes .setter
1934- def _codes (self , value : np .ndarray ):
1934+ def _codes (self , value : np .ndarray ) -> None :
19351935 warn (
19361936 "Setting the codes on a Categorical is deprecated and will raise in "
19371937 "a future version. Create a new Categorical object instead" ,
@@ -1985,7 +1985,7 @@ def __contains__(self, key) -> bool:
19851985 # ------------------------------------------------------------------
19861986 # Rendering Methods
19871987
1988- def _formatter (self , boxed : bool = False ):
1988+ def _formatter (self , boxed : bool = False ) -> None :
19891989 # Defer to CategoricalFormatter's formatter.
19901990 return None
19911991
@@ -2713,7 +2713,7 @@ def __init__(self, data) -> None:
27132713 self ._freeze ()
27142714
27152715 @staticmethod
2716- def _validate (data ):
2716+ def _validate (data ) -> None :
27172717 if not is_categorical_dtype (data .dtype ):
27182718 raise AttributeError ("Can only use .cat accessor with a 'category' dtype" )
27192719
0 commit comments