Repository: modin-project/modin

Issue:
Add type hints for Series functions



Discussion:

Resolving patch:
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -17,13 +17,14 @@
 
 import os
 import warnings
-from typing import IO, TYPE_CHECKING, Hashable, Optional, Union
+from typing import IO, TYPE_CHECKING, Any, Hashable, Iterable, Optional, Union
 
 import numpy as np
 import pandas
 from pandas._libs import lib
-from pandas._typing import Axis, IndexKeyFunc, Sequence
+from pandas._typing import ArrayLike, Axis, DtypeObj, IndexKeyFunc, Scalar, Sequence
 from pandas.api.types import is_integer
+from pandas.core.arrays import ExtensionArray
 from pandas.core.common import apply_if_callable, is_bool_indexer
 from pandas.core.dtypes.common import is_dict_like, is_list_like
 from pandas.core.series import _coerce_method
@@ -48,6 +49,8 @@
 from .utils import _doc_binary_op, cast_function_modin2pandas, is_scalar
 
 if TYPE_CHECKING:
+    import numpy.typing as npt
+
     from modin.core.storage_formats import BaseQueryCompiler
 
     from .dataframe import DataFrame
@@ -101,7 +104,7 @@ def __init__(
         copy=None,
         fastpath=lib.no_default,
         query_compiler: BaseQueryCompiler = None,
-    ):
+    ) -> None:
         from modin.numpy import array
 
         # Siblings are other dataframes that share the same query compiler. We
@@ -154,7 +157,7 @@ def __init__(
         if name is not None:
             self.name = name
 
-    def _get_name(self):
+    def _get_name(self) -> Hashable:
         """
         Get the value of the `name` property.
 
@@ -167,7 +170,7 @@ def _get_name(self):
             return None
         return name
 
-    def _set_name(self, name):
+    def _set_name(self, name: Hashable) -> None:
         """
         Set the value of the `name` property.
 
@@ -180,7 +183,7 @@ def _set_name(self, name):
             name = MODIN_UNNAMED_SERIES_LABEL
         self._query_compiler.columns = [name]
 
-    name = property(_get_name, _set_name)
+    name: Hashable = property(_get_name, _set_name)
     _parent = None
     # Parent axis denotes axis that was used to select series in a parent dataframe.
     # If _parent_axis == 0, then it means that index axis was used via df.loc[row]
@@ -190,22 +193,22 @@ def _set_name(self, name):
     _parent_axis = 0
 
     @_doc_binary_op(operation="addition", bin_op="add")
-    def __add__(self, right):
+    def __add__(self, right) -> Series:
         return self.add(right)
 
     @_doc_binary_op(operation="addition", bin_op="radd", right="left")
-    def __radd__(self, left):
+    def __radd__(self, left) -> Series:
         return self.radd(left)
 
     @_doc_binary_op(operation="union", bin_op="and", right="other")
-    def __and__(self, other):
+    def __and__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__and__, other)
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).__and__(new_other)
 
     @_doc_binary_op(operation="union", bin_op="and", right="other")
-    def __rand__(self, other):
+    def __rand__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__rand__, other)
         new_self, new_other = self._prepare_inter_op(other)
@@ -213,13 +216,13 @@ def __rand__(self, other):
 
     # add `_inherit_docstrings` decorator to force method link addition.
     @_inherit_docstrings(pandas.Series.__array__, apilink="pandas.Series.__array__")
-    def __array__(self, dtype=None):  # noqa: PR01, RT01, D200
+    def __array__(self, dtype=None) -> np.ndarray:  # noqa: PR01, RT01, D200
         """
         Return the values as a NumPy array.
         """
         return super(Series, self).__array__(dtype).flatten()
 
-    def __contains__(self, key):
+    def __contains__(self, key: Hashable) -> bool:
         """
         Check if `key` in the `Series.index`.
 
@@ -234,7 +237,7 @@ def __contains__(self, key):
         """
         return key in self.index
 
-    def __copy__(self, deep=True):
+    def __copy__(self, deep: bool = True) -> Series:
         """
         Return the copy of the Series.
 
@@ -249,7 +252,7 @@ def __copy__(self, deep=True):
         """
         return self.copy(deep=deep)
 
-    def __deepcopy__(self, memo=None):
+    def __deepcopy__(self, memo=None) -> Series:
         """
         Return the deep copy of the Series.
 
@@ -264,7 +267,7 @@ def __deepcopy__(self, memo=None):
         """
         return self.copy(deep=True)
 
-    def __delitem__(self, key):
+    def __delitem__(self, key: Hashable) -> None:
         """
         Delete item identified by `key` label.
 
@@ -282,7 +285,7 @@ def __delitem__(self, key):
         bin_op="divmod",
         returns="tuple of two Series",
     )
-    def __divmod__(self, right):
+    def __divmod__(self, right) -> tuple[Series, Series]:
         return self.divmod(right)
 
     @_doc_binary_op(
@@ -291,19 +294,19 @@ def __divmod__(self, right):
         right="left",
         returns="tuple of two Series",
     )
-    def __rdivmod__(self, left):
+    def __rdivmod__(self, left) -> tuple[Series, Series]:
         return self.rdivmod(left)
 
     @_doc_binary_op(operation="integer division", bin_op="floordiv")
-    def __floordiv__(self, right):
+    def __floordiv__(self, right) -> Series:
         return self.floordiv(right)
 
     @_doc_binary_op(operation="integer division", bin_op="floordiv")
-    def __rfloordiv__(self, right):
+    def __rfloordiv__(self, right) -> Series:
         return self.rfloordiv(right)
 
     @disable_logging
-    def __getattr__(self, key):
+    def __getattr__(self, key: Hashable) -> Any:
         """
         Return item identified by `key`.
 
@@ -342,58 +345,58 @@ def __iter__(self):
         return self._to_pandas().__iter__()
 
     @_doc_binary_op(operation="modulo", bin_op="mod")
-    def __mod__(self, right):
+    def __mod__(self, right) -> Series:
         return self.mod(right)
 
     @_doc_binary_op(operation="modulo", bin_op="mod", right="left")
-    def __rmod__(self, left):
+    def __rmod__(self, left) -> Series:
         return self.rmod(left)
 
     @_doc_binary_op(operation="multiplication", bin_op="mul")
-    def __mul__(self, right):
+    def __mul__(self, right) -> Series:
         return self.mul(right)
 
     @_doc_binary_op(operation="multiplication", bin_op="mul", right="left")
-    def __rmul__(self, left):
+    def __rmul__(self, left) -> Series:
         return self.rmul(left)
 
     @_doc_binary_op(operation="disjunction", bin_op="or", right="other")
-    def __or__(self, other):
+    def __or__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__or__, other)
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).__or__(new_other)
 
     @_doc_binary_op(operation="disjunction", bin_op="or", right="other")
-    def __ror__(self, other):
+    def __ror__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__ror__, other)
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).__ror__(new_other)
 
     @_doc_binary_op(operation="exclusive or", bin_op="xor", right="other")
-    def __xor__(self, other):
+    def __xor__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__xor__, other)
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).__xor__(new_other)
 
     @_doc_binary_op(operation="exclusive or", bin_op="xor", right="other")
-    def __rxor__(self, other):
+    def __rxor__(self, other) -> Series:
         if isinstance(other, (list, np.ndarray, pandas.Series)):
             return self._default_to_pandas(pandas.Series.__rxor__, other)
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).__rxor__(new_other)
 
     @_doc_binary_op(operation="exponential power", bin_op="pow")
-    def __pow__(self, right):
+    def __pow__(self, right) -> Series:
         return self.pow(right)
 
     @_doc_binary_op(operation="exponential power", bin_op="pow", right="left")
-    def __rpow__(self, left):
+    def __rpow__(self, left) -> Series:
         return self.rpow(left)
 
-    def __repr__(self):
+    def __repr__(self) -> str:
         """
         Return a string representation for a particular Series.
 
@@ -438,7 +441,7 @@ def __repr__(self):
             freq_str, name_str, len_str, dtype_str
         )
 
-    def __round__(self, decimals=0):
+    def __round__(self, decimals=0) -> Series:
         """
         Round each value in a Series to the given number of decimals.
 
@@ -455,7 +458,7 @@ def __round__(self, decimals=0):
             self._query_compiler.round(decimals=decimals)
         )
 
-    def __setitem__(self, key, value):
+    def __setitem__(self, key: Hashable, value: Any) -> None:
         """
         Set `value` identified by `key` in the Series.
 
@@ -472,19 +475,19 @@ def __setitem__(self, key, value):
             self.loc[key] = value
 
     @_doc_binary_op(operation="subtraction", bin_op="sub")
-    def __sub__(self, right):
+    def __sub__(self, right) -> Series:
         return self.sub(right)
 
     @_doc_binary_op(operation="subtraction", bin_op="sub", right="left")
-    def __rsub__(self, left):
+    def __rsub__(self, left) -> Series:
         return self.rsub(left)
 
     @_doc_binary_op(operation="floating division", bin_op="truediv")
-    def __truediv__(self, right):
+    def __truediv__(self, right) -> Series:
         return self.truediv(right)
 
     @_doc_binary_op(operation="floating division", bin_op="truediv", right="left")
-    def __rtruediv__(self, left):
+    def __rtruediv__(self, left) -> Series:
         return self.rtruediv(left)
 
     __iadd__ = __add__
@@ -514,7 +517,9 @@ def values(self):  # noqa: RT01, D200
             data = pd.Categorical(data, dtype=self.dtype)
         return data
 
-    def add(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def add(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return Addition of series and other, element-wise (binary operator add).
         """
@@ -525,7 +530,7 @@ def add(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01,
 
     def radd(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return Addition of series and other, element-wise (binary operator radd).
         """
@@ -534,7 +539,9 @@ def radd(
             new_other, level=level, fill_value=fill_value, axis=axis
         )
 
-    def add_prefix(self, prefix, axis=None):  # noqa: PR01, RT01, D200
+    def add_prefix(
+        self, prefix, axis=None
+    ) -> Union[DataFrame, Series]:  # noqa: PR01, RT01, D200
         """
         Prefix labels with string `prefix`.
         """
@@ -543,7 +550,9 @@ def add_prefix(self, prefix, axis=None):  # noqa: PR01, RT01, D200
             query_compiler=self._query_compiler.add_prefix(prefix, axis=axis)
         )
 
-    def add_suffix(self, suffix, axis=None):  # noqa: PR01, RT01, D200
+    def add_suffix(
+        self, suffix, axis=None
+    ) -> Union[DataFrame, Series]:  # noqa: PR01, RT01, D200
         """
         Suffix labels with string `suffix`.
         """
@@ -552,7 +561,9 @@ def add_suffix(self, suffix, axis=None):  # noqa: PR01, RT01, D200
             query_compiler=self._query_compiler.add_suffix(suffix, axis=axis)
         )
 
-    def aggregate(self, func=None, axis=0, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def aggregate(
+        self, func=None, axis=0, *args, **kwargs
+    ) -> Union[Series, Scalar]:  # noqa: PR01, RT01, D200
         """
         Aggregate using one or more operations over the specified axis.
         """
@@ -571,7 +582,7 @@ def error_raiser(msg, exception):
 
     def apply(
         self, func, convert_dtype=lib.no_default, args=(), by_row="compat", **kwargs
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[DataFrame, Series]:  # noqa: PR01, RT01, D200
         """
         Invoke function on values of Series.
         """
@@ -673,7 +684,9 @@ def f(x):
             return result.to_pandas().squeeze()
         return result
 
-    def transform(self, func, axis=0, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def transform(
+        self, func, axis=0, *args, **kwargs
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Call ``func`` on self producing a `BasePandasDataset` with the same axis shape as self.
         """
@@ -693,7 +706,9 @@ def transform(self, func, axis=0, *args, **kwargs):  # noqa: PR01, RT01, D200
             func = unique_func
         return super(Series, self).transform(func, axis, *args, **kwargs)
 
-    def argmax(self, axis=None, skipna=True, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def argmax(
+        self, axis=None, skipna=True, *args, **kwargs
+    ) -> int:  # noqa: PR01, RT01, D200
         """
         Return int position of the largest value in the Series.
         """
@@ -702,7 +717,9 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs):  # noqa: PR01, RT01,
             result = -1
         return result
 
-    def argmin(self, axis=None, skipna=True, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def argmin(
+        self, axis=None, skipna=True, *args, **kwargs
+    ) -> int:  # noqa: PR01, RT01, D200
         """
         Return int position of the smallest value in the Series.
         """
@@ -713,7 +730,7 @@ def argmin(self, axis=None, skipna=True, *args, **kwargs):  # noqa: PR01, RT01,
 
     def argsort(
         self, axis=0, kind="quicksort", order=None, stable=None
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return the integer indices that would sort the Series values.
         """
@@ -727,13 +744,15 @@ def argsort(
             )
         )
 
-    def autocorr(self, lag=1):  # noqa: PR01, RT01, D200
+    def autocorr(self, lag=1) -> float:  # noqa: PR01, RT01, D200
         """
         Compute the lag-N autocorrelation.
         """
         return self.corr(self.shift(lag))
 
-    def between(self, left, right, inclusive: str = "both"):  # noqa: PR01, RT01, D200
+    def between(
+        self, left, right, inclusive: str = "both"
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return boolean Series equivalent to left <= series <= right.
         """
@@ -741,7 +760,7 @@ def between(self, left, right, inclusive: str = "both"):  # noqa: PR01, RT01, D2
         # so passing a Modin Series there is safe
         return pandas.Series.between(self, left, right, inclusive)
 
-    def combine(self, other, func, fill_value=None):  # noqa: PR01, RT01, D200
+    def combine(self, other, func, fill_value=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Combine the Series with a Series or scalar according to `func`.
         """
@@ -756,7 +775,7 @@ def compare(
         keep_shape: bool = False,
         keep_equal: bool = False,
         result_names: tuple = ("self", "other"),
-    ) -> "Series":  # noqa: PR01, RT01, D200
+    ) -> Union[DataFrame, Series]:  # noqa: PR01, RT01, D200
         """
         Compare to another Series and show the differences.
         """
@@ -777,7 +796,9 @@ def compare(
             result = result.squeeze().rename(None)
         return result
 
-    def corr(self, other, method="pearson", min_periods=None):  # noqa: PR01, RT01, D200
+    def corr(
+        self, other, method="pearson", min_periods=None
+    ) -> float:  # noqa: PR01, RT01, D200
         """
         Compute correlation with `other` Series, excluding missing values.
         """
@@ -827,7 +848,7 @@ def corr(self, other, method="pearson", min_periods=None):  # noqa: PR01, RT01,
             query_compiler=self._query_compiler.series_corr(other, method, min_periods)
         )
 
-    def count(self):  # noqa: PR01, RT01, D200
+    def count(self) -> int:  # noqa: PR01, RT01, D200
         """
         Return number of non-NA/null observations in the Series.
         """
@@ -835,7 +856,7 @@ def count(self):  # noqa: PR01, RT01, D200
 
     def cov(
         self, other, min_periods=None, ddof: Optional[int] = 1
-    ):  # noqa: PR01, RT01, D200
+    ) -> float:  # noqa: PR01, RT01, D200
         """
         Compute covariance with Series, excluding missing values.
         """
@@ -875,7 +896,7 @@ def describe(
         percentiles=None,
         include=None,
         exclude=None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[DataFrame, Series]:  # noqa: PR01, RT01, D200
         """
         Generate descriptive statistics.
         """
@@ -886,7 +907,7 @@ def describe(
             exclude=None,
         )
 
-    def diff(self, periods=1):  # noqa: PR01, RT01, D200
+    def diff(self, periods=1) -> Series:  # noqa: PR01, RT01, D200
         """
         First discrete difference of element.
         """
@@ -894,7 +915,7 @@ def diff(self, periods=1):  # noqa: PR01, RT01, D200
 
     def divmod(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> tuple[Series, Series]:  # noqa: PR01, RT01, D200
         """
         Return Integer division and modulo of series and `other`, element-wise (binary operator `divmod`).
         """
@@ -905,7 +926,7 @@ def divmod(
             query_compiler=modulo
         )
 
-    def dot(self, other):  # noqa: PR01, RT01, D200
+    def dot(self, other) -> Union[Series, np.ndarray]:  # noqa: PR01, RT01, D200
         """
         Compute the dot product between the Series and the columns of `other`.
         """
@@ -945,7 +966,7 @@ def dot(self, other):  # noqa: PR01, RT01, D200
 
     def drop_duplicates(
         self, *, keep="first", inplace=False, ignore_index=False
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Return Series with duplicate values removed.
         """
@@ -955,7 +976,7 @@ def drop_duplicates(
 
     def dropna(
         self, *, axis=0, inplace=False, how=None, ignore_index=False
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Return a new Series with missing values removed.
         """
@@ -963,20 +984,22 @@ def dropna(
             axis=axis, inplace=inplace, ignore_index=ignore_index
         )
 
-    def duplicated(self, keep="first"):  # noqa: PR01, RT01, D200
+    def duplicated(self, keep="first") -> Series:  # noqa: PR01, RT01, D200
         """
         Indicate duplicate Series values.
         """
         return self.to_frame().duplicated(keep=keep)
 
-    def eq(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def eq(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return Equal to of series and `other`, element-wise (binary operator `eq`).
         """
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).eq(new_other, level=level, axis=axis)
 
-    def equals(self, other):  # noqa: PR01, RT01, D200
+    def equals(self, other) -> bool:  # noqa: PR01, RT01, D200
         """
         Test whether two objects contain the same elements.
         """
@@ -1001,7 +1024,7 @@ def equals(self, other):  # noqa: PR01, RT01, D200
             other.name = old_name_other
         return res.all()
 
-    def explode(self, ignore_index: bool = False):  # noqa: PR01, RT01, D200
+    def explode(self, ignore_index: bool = False) -> Series:  # noqa: PR01, RT01, D200
         """
         Transform each element of a list-like to a row.
         """
@@ -1020,7 +1043,7 @@ def factorize(self, sort=False, use_na_sentinel=True):  # noqa: PR01, RT01, D200
             use_na_sentinel=use_na_sentinel,
         )
 
-    def case_when(self, caselist):  # noqa: PR01, RT01, D200
+    def case_when(self, caselist) -> Series:  # noqa: PR01, RT01, D200
         """
         Replace values where the conditions are True.
         """
@@ -1045,7 +1068,7 @@ def fillna(
         inplace=False,
         limit=None,
         downcast=lib.no_default,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Fill NaNs inside of a Series object.
         """
@@ -1067,16 +1090,18 @@ def fillna(
 
     def floordiv(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
-        Get Integer division of dataframe and `other`, element-wise (binary operator `floordiv`).
+        Get Integer division of series and `other`, element-wise (binary operator `floordiv`).
         """
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).floordiv(
             new_other, level=level, fill_value=None, axis=axis
         )
 
-    def ge(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def ge(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return greater than or equal to of series and `other`, element-wise (binary operator `ge`).
         """
@@ -1122,7 +1147,9 @@ def groupby(
             dropna=dropna,
         )
 
-    def gt(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def gt(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return greater than of series and `other`, element-wise (binary operator `gt`).
         """
@@ -1163,13 +1190,17 @@ def hist(
             **kwargs,
         )
 
-    def idxmax(self, axis=0, skipna=True, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def idxmax(
+        self, axis=0, skipna=True, *args, **kwargs
+    ) -> Hashable:  # noqa: PR01, RT01, D200
         """
         Return the row label of the maximum value.
         """
         return super(Series, self).idxmax(axis=axis, skipna=skipna, *args, **kwargs)
 
-    def idxmin(self, axis=0, skipna=True, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def idxmin(
+        self, axis=0, skipna=True, *args, **kwargs
+    ) -> Hashable:  # noqa: PR01, RT01, D200
         """
         Return the row label of the minimum value.
         """
@@ -1182,7 +1213,7 @@ def info(
         max_cols: int | None = None,
         memory_usage: bool | str | None = None,
         show_counts: bool = True,
-    ):
+    ) -> None:
         return SeriesInfo(self, memory_usage).render(
             buf=buf,
             max_cols=max_cols,
@@ -1190,7 +1221,7 @@ def info(
             show_counts=show_counts,
         )
 
-    def isna(self):
+    def isna(self) -> Series:
         """
         Detect missing values.
 
@@ -1200,7 +1231,7 @@ def isna(self):
         """
         return super(Series, self).isna()
 
-    def isnull(self):
+    def isnull(self) -> Series:
         """
         Detect missing values.
 
@@ -1210,13 +1241,13 @@ def isnull(self):
         """
         return super(Series, self).isnull()
 
-    def item(self):  # noqa: RT01, D200
+    def item(self) -> Scalar:  # noqa: RT01, D200
         """
         Return the first element of the underlying data as a Python scalar.
         """
         return self[0]
 
-    def items(self):  # noqa: D200
+    def items(self) -> Iterable[tuple[Hashable, Any]]:  # noqa: D200
         """
         Lazily iterate over (index, value) tuples.
         """
@@ -1228,27 +1259,31 @@ def item_builder(s):
         for v in partition_iterator:
             yield v
 
-    def keys(self):  # noqa: RT01, D200
+    def keys(self) -> pandas.Index:  # noqa: RT01, D200
         """
         Return alias for index.
         """
         return self.index
 
-    def le(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def le(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return less than or equal to of series and `other`, element-wise (binary operator `le`).
         """
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).le(new_other, level=level, axis=axis)
 
-    def lt(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def lt(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return less than of series and `other`, element-wise (binary operator `lt`).
         """
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).lt(new_other, level=level, axis=axis)
 
-    def map(self, arg, na_action=None):  # noqa: PR01, RT01, D200
+    def map(self, arg, na_action=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Map values of Series according to input correspondence.
         """
@@ -1281,7 +1316,7 @@ def sem(
         ddof: int = 1,
         numeric_only=False,
         **kwargs,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[float, Series]:  # noqa: PR01, RT01, D200
         """
         Return unbiased standard error of the mean over requested axis.
         """
@@ -1296,7 +1331,7 @@ def std(
         ddof: int = 1,
         numeric_only=False,
         **kwargs,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[float, Series]:  # noqa: PR01, RT01, D200
         """
         Return sample standard deviation over requested axis.
         """
@@ -1311,7 +1346,7 @@ def var(
         ddof: int = 1,
         numeric_only=False,
         **kwargs,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[float, Series]:  # noqa: PR01, RT01, D200
         """
         Return unbiased variance over requested axis.
         """
@@ -1319,13 +1354,15 @@ def var(
             "var", axis, skipna, numeric_only, ddof=ddof, **kwargs
         )
 
-    def memory_usage(self, index=True, deep=False):  # noqa: PR01, RT01, D200
+    def memory_usage(self, index=True, deep=False) -> int:  # noqa: PR01, RT01, D200
         """
         Return the memory usage of the Series.
         """
         return super(Series, self).memory_usage(index=index, deep=deep).sum()
 
-    def mod(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def mod(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return Modulo of series and `other`, element-wise (binary operator `mod`).
         """
@@ -1334,13 +1371,15 @@ def mod(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01,
             new_other, level=level, fill_value=None, axis=axis
         )
 
-    def mode(self, dropna=True):  # noqa: PR01, RT01, D200
+    def mode(self, dropna=True) -> Series:  # noqa: PR01, RT01, D200
         """
         Return the mode(s) of the Series.
         """
         return super(Series, self).mode(numeric_only=False, dropna=dropna)
 
-    def mul(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def mul(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return multiplication of series and `other`, element-wise (binary operator `mul`).
         """
@@ -1353,7 +1392,7 @@ def mul(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01,
 
     def rmul(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return multiplication of series and `other`, element-wise (binary operator `mul`).
         """
@@ -1362,14 +1401,16 @@ def rmul(
             new_other, level=level, fill_value=None, axis=axis
         )
 
-    def ne(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def ne(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return not equal to of series and `other`, element-wise (binary operator `ne`).
         """
         new_self, new_other = self._prepare_inter_op(other)
         return super(Series, new_self).ne(new_other, level=level, axis=axis)
 
-    def nlargest(self, n=5, keep="first"):  # noqa: PR01, RT01, D200
+    def nlargest(self, n=5, keep="first") -> Series:  # noqa: PR01, RT01, D200
         """
         Return the largest `n` elements.
         """
@@ -1382,7 +1423,7 @@ def nlargest(self, n=5, keep="first"):  # noqa: PR01, RT01, D200
             )
         )
 
-    def nsmallest(self, n=5, keep="first"):  # noqa: PR01, RT01, D200
+    def nsmallest(self, n=5, keep="first") -> Series:  # noqa: PR01, RT01, D200
         """
         Return the smallest `n` elements.
         """
@@ -1402,7 +1443,7 @@ def shift(
         axis=0,
         fill_value=lib.no_default,
         suffix=None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Shift index by desired number of periods with an optional time `freq`.
         """
@@ -1420,7 +1461,9 @@ def shift(
             periods=periods, freq=freq, axis=axis, fill_value=fill_value
         )
 
-    def unstack(self, level=-1, fill_value=None, sort=True):  # noqa: PR01, RT01, D200
+    def unstack(
+        self, level=-1, fill_value=None, sort=True
+    ) -> DataFrame:  # noqa: PR01, RT01, D200
         """
         Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.
         """
@@ -1477,7 +1520,9 @@ def plot(
         """
         return self._to_pandas().plot
 
-    def pow(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def pow(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return exponential power of series and `other`, element-wise (binary operator `pow`).
         """
@@ -1494,7 +1539,7 @@ def prod(
         numeric_only=False,
         min_count=0,
         **kwargs,
-    ):
+    ) -> Scalar:
         validate_bool_kwarg(skipna, "skipna", none_allowed=False)
         axis = self._get_axis_number(axis)
         new_index = self.columns if axis else self.index
@@ -1524,7 +1569,7 @@ def prod(
 
     product = prod
 
-    def ravel(self, order="C"):  # noqa: PR01, RT01, D200
+    def ravel(self, order="C") -> ArrayLike:  # noqa: PR01, RT01, D200
         """
         Return the flattened underlying data as an ndarray.
         """
@@ -1546,7 +1591,7 @@ def reindex(
         fill_value=None,
         limit: int = None,
         tolerance=None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         if fill_value is None:
             fill_value = np.nan
         return super(Series, self).reindex(
@@ -1568,7 +1613,7 @@ def rename_axis(
         axis=0,
         copy=True,
         inplace=False,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Set the name of the axis for the index or columns.
         """
@@ -1585,7 +1630,7 @@ def rename(
         inplace=False,
         level=None,
         errors="ignore",
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Alter Series index labels or name.
         """
@@ -1606,7 +1651,7 @@ def rename(
             result.name = self.name
             return result
 
-    def repeat(self, repeats, axis=None):  # noqa: PR01, RT01, D200
+    def repeat(self, repeats, axis=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Repeat elements of a Series.
         """
@@ -1625,7 +1670,7 @@ def reset_index(
         name=lib.no_default,
         inplace=False,
         allow_duplicates=False,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[DataFrame, Series, None]:  # noqa: PR01, RT01, D200
         """
         Generate a new Series with the index reset.
         """
@@ -1665,7 +1710,7 @@ def reset_index(
 
     def rdivmod(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return integer division and modulo of series and `other`, element-wise (binary operator `rdivmod`).
         """
@@ -1678,7 +1723,7 @@ def rdivmod(
 
     def rfloordiv(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return integer division of series and `other`, element-wise (binary operator `rfloordiv`).
         """
@@ -1689,7 +1734,7 @@ def rfloordiv(
 
     def rmod(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return modulo of series and `other`, element-wise (binary operator `rmod`).
         """
@@ -1700,7 +1745,7 @@ def rmod(
 
     def rpow(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return exponential power of series and `other`, element-wise (binary operator `rpow`).
         """
@@ -1711,7 +1756,7 @@ def rpow(
 
     def rsub(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return subtraction of series and `other`, element-wise (binary operator `rsub`).
         """
@@ -1722,7 +1767,7 @@ def rsub(
 
     def rtruediv(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return floating division of series and `other`, element-wise (binary operator `rtruediv`).
         """
@@ -1733,7 +1778,9 @@ def rtruediv(
 
     rdiv = rtruediv
 
-    def quantile(self, q=0.5, interpolation="linear"):  # noqa: PR01, RT01, D200
+    def quantile(
+        self, q=0.5, interpolation="linear"
+    ) -> Union[float, Series]:  # noqa: PR01, RT01, D200
         """
         Return value at the given quantile.
         """
@@ -1745,7 +1792,7 @@ def quantile(self, q=0.5, interpolation="linear"):  # noqa: PR01, RT01, D200
             method="single",
         )
 
-    def reorder_levels(self, order):  # noqa: PR01, RT01, D200
+    def reorder_levels(self, order) -> Series:  # noqa: PR01, RT01, D200
         """
         Rearrange index levels using input order.
         """
@@ -1760,7 +1807,7 @@ def replace(
         limit=None,
         regex=False,
         method: str | lib.NoDefault = lib.no_default,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Replace values given in `to_replace` with `value`.
         """
@@ -1775,7 +1822,9 @@ def replace(
         )
         return self._create_or_update_from_compiler(new_query_compiler, inplace)
 
-    def searchsorted(self, value, side="left", sorter=None):  # noqa: PR01, RT01, D200
+    def searchsorted(
+        self, value, side="left", sorter=None
+    ) -> Union[npt.NDArray[np.intp], np.intp]:  # noqa: PR01, RT01, D200
         """
         Find indices where elements should be inserted to maintain order.
         """
@@ -1818,7 +1867,7 @@ def sort_values(
         na_position="last",
         ignore_index: bool = False,
         key: Optional[IndexKeyFunc] = None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Sort by the values.
         """
@@ -1852,7 +1901,7 @@ def sort_values(
     list = CachedAccessor("list", ListAccessor)
     struct = CachedAccessor("struct", StructAccessor)
 
-    def squeeze(self, axis=None):  # noqa: PR01, RT01, D200
+    def squeeze(self, axis=None) -> Union[Series, Scalar]:  # noqa: PR01, RT01, D200
         """
         Squeeze 1 dimensional axis objects into scalars.
         """
@@ -1864,7 +1913,9 @@ def squeeze(self, axis=None):  # noqa: PR01, RT01, D200
         else:
             return self.copy()
 
-    def sub(self, other, level=None, fill_value=None, axis=0):  # noqa: PR01, RT01, D200
+    def sub(
+        self, other, level=None, fill_value=None, axis=0
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return subtraction of Series and `other`, element-wise (binary operator `sub`).
         """
@@ -1882,7 +1933,7 @@ def sum(
         numeric_only=False,
         min_count=0,
         **kwargs,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Scalar:  # noqa: PR01, RT01, D200
         """
         Return the sum of the values.
         """
@@ -1916,7 +1967,7 @@ def sum(
             )
         )
 
-    def swaplevel(self, i=-2, j=-1, copy=None):  # noqa: PR01, RT01, D200
+    def swaplevel(self, i=-2, j=-1, copy=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Swap levels `i` and `j` in a `MultiIndex`.
         """
@@ -1924,13 +1975,13 @@ def swaplevel(self, i=-2, j=-1, copy=None):  # noqa: PR01, RT01, D200
         obj = self.copy() if copy else self
         return super(Series, obj).swaplevel(i, j, axis=0)
 
-    def take(self, indices, axis=0, **kwargs):  # noqa: PR01, RT01, D200
+    def take(self, indices, axis=0, **kwargs) -> Series:  # noqa: PR01, RT01, D200
         """
         Return the elements in the given positional indices along an axis.
         """
         return super(Series, self).take(indices, axis=axis, **kwargs)
 
-    def to_dict(self, into=dict):  # pragma: no cover # noqa: PR01, RT01, D200
+    def to_dict(self, into=dict) -> dict:  # pragma: no cover # noqa: PR01, RT01, D200
         """
         Convert Series to {label -> value} dict or dict-like object.
         """
@@ -1938,7 +1989,7 @@ def to_dict(self, into=dict):  # pragma: no cover # noqa: PR01, RT01, D200
 
     def to_frame(
         self, name: Hashable = lib.no_default
-    ) -> "DataFrame":  # noqa: PR01, RT01, D200
+    ) -> DataFrame:  # noqa: PR01, RT01, D200
         """
         Convert Series to {label -> value} dict or dict-like object.
         """
@@ -1953,7 +2004,7 @@ def to_frame(
 
         return DataFrame(self_cp)
 
-    def to_list(self):  # noqa: RT01, D200
+    def to_list(self) -> list:  # noqa: RT01, D200
         """
         Return a list of the values.
         """
@@ -1961,7 +2012,7 @@ def to_list(self):  # noqa: RT01, D200
 
     def to_numpy(
         self, dtype=None, copy=False, na_value=lib.no_default, **kwargs
-    ):  # noqa: PR01, RT01, D200
+    ) -> np.ndarray:  # noqa: PR01, RT01, D200
         """
         Return the NumPy ndarray representing the values in this Series or Index.
         """
@@ -1986,7 +2037,7 @@ def to_numpy(
 
     # TODO(williamma12): When we implement to_timestamp, have this call the version
     # in base.py
-    def to_period(self, freq=None, copy=None):  # noqa: PR01, RT01, D200
+    def to_period(self, freq=None, copy=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Cast to PeriodArray/Index at a particular frequency.
         """
@@ -2004,7 +2055,7 @@ def to_string(
         name=False,
         max_rows=None,
         min_rows=None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[str, None]:  # noqa: PR01, RT01, D200
         """
         Render a string representation of the Series.
         """
@@ -2023,13 +2074,15 @@ def to_string(
 
     # TODO(williamma12): When we implement to_timestamp, have this call the version
     # in base.py
-    def to_timestamp(self, freq=None, how="start", copy=None):  # noqa: PR01, RT01, D200
+    def to_timestamp(
+        self, freq=None, how="start", copy=None
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Cast to DatetimeIndex of Timestamps, at beginning of period.
         """
         return self._default_to_pandas("to_timestamp", freq=freq, how=how, copy=copy)
 
-    def transpose(self, *args, **kwargs):  # noqa: PR01, RT01, D200
+    def transpose(self, *args, **kwargs) -> Series:  # noqa: PR01, RT01, D200
         """
         Return the transpose, which is by definition `self`.
         """
@@ -2039,7 +2092,7 @@ def transpose(self, *args, **kwargs):  # noqa: PR01, RT01, D200
 
     def truediv(
         self, other, level=None, fill_value=None, axis=0
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return floating division of series and `other`, element-wise (binary operator `truediv`).
         """
@@ -2050,7 +2103,7 @@ def truediv(
 
     div = divide = truediv
 
-    def unique(self):  # noqa: RT01, D200
+    def unique(self) -> ArrayLike:  # noqa: RT01, D200
         """
         Return unique values of Series object.
         """
@@ -2058,7 +2111,7 @@ def unique(self):  # noqa: RT01, D200
             query_compiler=self._query_compiler.unique()
         ).to_numpy()
 
-    def update(self, other):  # noqa: PR01, D200
+    def update(self, other) -> None:  # noqa: PR01, D200
         """
         Modify Series in place using values from passed Series.
         """
@@ -2069,7 +2122,7 @@ def update(self, other):  # noqa: PR01, D200
 
     def value_counts(
         self, normalize=False, sort=True, ascending=False, bins=None, dropna=True
-    ):  # noqa: PR01, RT01, D200
+    ) -> Series:  # noqa: PR01, RT01, D200
         """
         Return a Series containing counts of unique values.
         """
@@ -2094,7 +2147,7 @@ def value_counts(
         )
         return counted_values
 
-    def view(self, dtype=None):  # noqa: PR01, RT01, D200
+    def view(self, dtype=None) -> Series:  # noqa: PR01, RT01, D200
         """
         Create a new view of the Series.
         """
@@ -2110,7 +2163,7 @@ def where(
         inplace=False,
         axis=None,
         level=None,
-    ):  # noqa: PR01, RT01, D200
+    ) -> Union[Series, None]:  # noqa: PR01, RT01, D200
         """
         Replace values where the condition is False.
         """
@@ -2129,7 +2182,7 @@ def where(
         )
 
     @property
-    def attrs(self):  # noqa: RT01, D200
+    def attrs(self) -> dict:  # noqa: RT01, D200
         """
         Return dictionary of global attributes of this dataset.
         """
@@ -2140,7 +2193,7 @@ def attrs(df):
         return self._default_to_pandas(attrs)
 
     @property
-    def array(self):  # noqa: RT01, D200
+    def array(self) -> ExtensionArray:  # noqa: RT01, D200
         """
         Return the ExtensionArray of the data backing this Series or Index.
         """
@@ -2151,14 +2204,14 @@ def array(df):
         return self._default_to_pandas(array)
 
     @property
-    def axes(self):  # noqa: RT01, D200
+    def axes(self) -> list[pandas.Index]:  # noqa: RT01, D200
         """
         Return a list of the row axis labels.
         """
         return [self.index]
 
     @property
-    def dtype(self):  # noqa: RT01, D200
+    def dtype(self) -> DtypeObj:  # noqa: RT01, D200
         """
         Return the dtype object of the underlying data.
         """
@@ -2167,75 +2220,75 @@ def dtype(self):  # noqa: RT01, D200
     dtypes = dtype
 
     @property
-    def empty(self):  # noqa: RT01, D200
+    def empty(self) -> bool:  # noqa: RT01, D200
         """
         Indicate whether Series is empty.
         """
         return len(self.index) == 0
 
     @property
-    def hasnans(self):  # noqa: RT01, D200
+    def hasnans(self) -> bool:  # noqa: RT01, D200
         """
         Return True if Series has any nans.
         """
         return self.isna().sum() > 0
 
     @property
-    def is_monotonic_increasing(self):  # noqa: RT01, D200
+    def is_monotonic_increasing(self) -> bool:  # noqa: RT01, D200
         """
         Return True if values in the Series are monotonic_increasing.
         """
         return self._reduce_dimension(self._query_compiler.is_monotonic_increasing())
 
     @property
-    def is_monotonic_decreasing(self):  # noqa: RT01, D200
+    def is_monotonic_decreasing(self) -> bool:  # noqa: RT01, D200
         """
         Return True if values in the Series are monotonic_decreasing.
         """
         return self._reduce_dimension(self._query_compiler.is_monotonic_decreasing())
 
     @property
-    def is_unique(self):  # noqa: RT01, D200
+    def is_unique(self) -> bool:  # noqa: RT01, D200
         """
         Return True if values in the Series are unique.
         """
         return self.nunique(dropna=False) == len(self)
 
     @property
-    def nbytes(self):  # noqa: RT01, D200
+    def nbytes(self) -> int:  # noqa: RT01, D200
         """
         Return the number of bytes in the underlying data.
         """
         return self.memory_usage(index=False)
 
     @property
-    def ndim(self):  # noqa: RT01, D200
+    def ndim(self) -> int:  # noqa: RT01, D200
         """
         Return the number of dimensions of the underlying data, by definition 1.
         """
         return 1
 
-    def nunique(self, dropna=True):  # noqa: PR01, RT01, D200
+    def nunique(self, dropna=True) -> int:  # noqa: PR01, RT01, D200
         """
         Return number of unique elements in the object.
         """
         return super(Series, self).nunique(dropna=dropna)
 
     @property
-    def shape(self):  # noqa: RT01, D200
+    def shape(self) -> tuple[int]:  # noqa: RT01, D200
         """
         Return a tuple of the shape of the underlying data.
         """
         return (len(self),)
 
     def reindex_like(
-        self: "Series",
+        self,
         other,
         method=None,
         copy: Optional[bool] = None,
         limit=None,
         tolerance=None,
-    ) -> "Series":
+    ) -> Series:
         # docs say "Same as calling .reindex(index=other.index, columns=other.columns,...).":
         # https://pandas.pydata.org/pandas-docs/version/1.4/reference/api/pandas.Series.reindex_like.html
         return self.reindex(
@@ -2246,7 +2299,7 @@ def reindex_like(
             tolerance=tolerance,
         )
 
-    def _to_pandas(self):
+    def _to_pandas(self) -> pandas.Series:
         """
         Convert Modin Series to pandas Series.
 
@@ -2262,7 +2315,7 @@ def _to_pandas(self):
             series.name = None
         return series
 
-    def _to_datetime(self, **kwargs):
+    def _to_datetime(self, **kwargs) -> Series:
         """
         Convert `self` to datetime.
 
@@ -2281,7 +2334,7 @@ def _to_datetime(self, **kwargs):
             query_compiler=self._query_compiler.to_datetime(**kwargs)
         )
 
-    def _to_numeric(self, **kwargs):
+    def _to_numeric(self, **kwargs) -> Series:
         """
         Convert `self` to numeric.
 
@@ -2306,7 +2359,7 @@ def _qcut(self, q, **kwargs):  # noqa: PR01, RT01, D200
         """
         return self._default_to_pandas(pandas.qcut, q, **kwargs)
 
-    def _reduce_dimension(self, query_compiler):
+    def _reduce_dimension(self, query_compiler) -> Union[Series, None]:
         """
         Try to reduce the dimension of data from the `query_compiler`.
 
@@ -2317,11 +2370,13 @@ def _reduce_dimension(self, query_compiler):
 
         Returns
         -------
-        pandas.Series or pandas.DataFrame.
+        pandas.Series or scalar.
         """
         return query_compiler.to_pandas().squeeze()
 
-    def _validate_dtypes_sum_prod_mean(self, axis, numeric_only, ignore_axis=False):
+    def _validate_dtypes_sum_prod_mean(
+        self, axis, numeric_only, ignore_axis=False
+    ) -> Series:
         """
         Validate data dtype for `sum`, `prod` and `mean` methods.
 
@@ -2347,7 +2402,7 @@ def _validate_dtypes_sum_prod_mean(self, axis, numeric_only, ignore_axis=False):
         """
         return self
 
-    def _validate_dtypes_min_max(self, axis, numeric_only):
+    def _validate_dtypes_min_max(self, axis, numeric_only) -> Series:
         """
         Validate data dtype for `min` and `max` methods.
 
@@ -2370,7 +2425,7 @@ def _validate_dtypes_min_max(self, axis, numeric_only):
         """
         return self
 
-    def _validate_dtypes(self, numeric_only=False):
+    def _validate_dtypes(self, numeric_only=False) -> None:
         """
         Check that all the dtypes are the same.
 
@@ -2387,7 +2442,7 @@ def _validate_dtypes(self, numeric_only=False):
         """
         pass
 
-    def _get_numeric_data(self, axis: int):
+    def _get_numeric_data(self, axis: int) -> Series:
         """
         Grab only numeric data from Series.
 
@@ -2407,7 +2462,7 @@ def _get_numeric_data(self, axis: int):
         """
         return self
 
-    def _update_inplace(self, new_query_compiler):
+    def _update_inplace(self, new_query_compiler) -> None:
         """
         Update the current Series in-place using `new_query_compiler`.
 
@@ -2424,7 +2479,9 @@ def _update_inplace(self, new_query_compiler):
             else:
                 self._parent[self.name] = self
 
-    def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):
+    def _create_or_update_from_compiler(
+        self, new_query_compiler, inplace=False
+    ) -> Union[Series, None]:
         """
         Return or update a Series with given `new_query_compiler`.
 
@@ -2437,8 +2494,8 @@ def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):
 
         Returns
         -------
-        Series, DataFrame or None
-            None if update was done, Series or DataFrame otherwise.
+        Series or None
+            None if update was done, Series otherwise.
         """
         assert (
             isinstance(new_query_compiler, type(self._query_compiler))
@@ -2454,7 +2511,7 @@ def _create_or_update_from_compiler(self, new_query_compiler, inplace=False):
         else:
             self._update_inplace(new_query_compiler=new_query_compiler)
 
-    def _prepare_inter_op(self, other):
+    def _prepare_inter_op(self, other) -> tuple[Series, Series]:
         """
         Prepare `self` and `other` for further interaction.
 
@@ -2486,7 +2543,7 @@ def _prepare_inter_op(self, other):
             new_other = other
         return new_self, new_other
 
-    def _getitem(self, key):
+    def _getitem(self, key) -> Union[Series, Scalar]:
         """
         Get the data specified by `key` for this Series.
 
@@ -2497,8 +2554,8 @@ def _getitem(self, key):
 
         Returns
         -------
-        Series
-            Series with retrieved data.
+        Series or scalar
+            Retrieved data.
         """
         key = apply_if_callable(key, self)
         if isinstance(key, Series) and key.dtype == np.bool_:
@@ -2536,7 +2593,7 @@ def _getitem(self, key):
             return self._reduce_dimension(result)
         return self.__constructor__(query_compiler=result)
 
-    def _repartition(self):
+    def _repartition(self) -> Series:
         """
         Repartitioning Series to get ideal partitions inside.
 
@@ -2552,7 +2609,7 @@ def _repartition(self):
 
     # Persistance support methods - BEGIN
     @classmethod
-    def _inflate_light(cls, query_compiler, name, source_pid):
+    def _inflate_light(cls, query_compiler, name, source_pid) -> Series:
         """
         Re-creates the object from previously-serialized lightweight representation.
 
@@ -2586,7 +2643,7 @@ def _inflate_light(cls, query_compiler, name, source_pid):
         return cls(query_compiler=query_compiler, name=name)
 
     @classmethod
-    def _inflate_full(cls, pandas_series, source_pid):
+    def _inflate_full(cls, pandas_series, source_pid) -> Series:
         """
         Re-creates the object from previously-serialized disk-storable representation.
 


Test patch: