Repository: modin-project/modin

Issue:
BUG: Series.rename_axis raises AttributeError
### Modin version checks

- [x] I have checked that this issue has not already been reported.

- [x] I have confirmed this bug exists on the latest released version of Modin.

- [x] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow [this guide](https://modin.readthedocs.io/en/stable/getting_started/installation.html#installing-from-the-github-main-branch).)


### Reproducible Example

```python
import modin.pandas as pd
s = pd.Series(["dog", "cat", "monkey"])
s.rename_axis("animal")
```

### Issue Description

`Series.rename_axis` should rename the index of the series, but currently raises due to a missing method.

Found in Snowpark pandas: https://github.com/snowflakedb/snowpark-python/pull/3040

### Expected Behavior

Does not raise and renames the index.

### Error Logs

<details>

```python-traceback
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/joshi/code/modin/modin/logging/logger_decorator.py", line 149, in run_and_log
    result = obj(*args, **kwargs)
  File "/Users/joshi/code/modin/modin/pandas/series.py", line 1701, in rename_axis
    return super().rename_axis(
  File "/Users/joshi/code/modin/modin/logging/logger_decorator.py", line 149, in run_and_log
    result = obj(*args, **kwargs)
  File "/Users/joshi/code/modin/modin/pandas/base.py", line 2565, in rename_axis
    return self._set_axis_name(mapper, axis=axis, inplace=inplace)
  File "/Users/joshi/code/modin/modin/pandas/series.py", line 358, in __getattr__
    raise err
  File "/Users/joshi/code/modin/modin/pandas/series.py", line 354, in __getattr__
    return _SERIES_EXTENSIONS_.get(key, object.__getattribute__(self, key))
AttributeError: 'Series' object has no attribute '_set_axis_name'. Did you mean: '_get_axis_number'?
```

</details>


### Installed Versions

<details>

INSTALLED VERSIONS
------------------
commit                : c114e7b0a38ff025c5f69ff752510a62ede6506f
python                : 3.10.13.final.0
python-bits           : 64
OS                    : Darwin
OS-release            : 24.3.0
Version               : Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020
machine               : arm64
processor             : arm
byteorder             : little
LC_ALL                : None
LANG                  : en_US.UTF-8
LOCALE                : en_US.UTF-8

Modin dependencies
------------------
modin                 : 0.32.0+19.gc114e7b0.dirty
ray                   : 2.34.0
dask                  : 2024.8.1
distributed           : 2024.8.1

pandas dependencies
-------------------
pandas                : 2.2.2
numpy                 : 1.26.4
pytz                  : 2023.3.post1
dateutil              : 2.8.2
setuptools            : 68.0.0
pip                   : 23.3
Cython                : None
pytest                : 8.3.2
hypothesis            : None
sphinx                : 5.3.0
blosc                 : None
feather               : None
xlsxwriter            : None
lxml.etree            : 5.3.0
html5lib              : None
pymysql               : None
psycopg2              : 2.9.9
jinja2                : 3.1.4
IPython               : 8.17.2
pandas_datareader     : None
adbc-driver-postgresql: None
adbc-driver-sqlite    : None
bs4                   : 4.12.2
bottleneck            : None
dataframe-api-compat  : None
fastparquet           : 2024.5.0
fsspec                : 2024.6.1
gcsfs                 : None
matplotlib            : 3.9.2
numba                 : None
numexpr               : 2.10.1
odfpy                 : None
openpyxl              : 3.1.5
pandas_gbq            : 0.23.1
pyarrow               : 17.0.0
pyreadstat            : None
python-calamine       : None
pyxlsb                : None
s3fs                  : 2024.6.1
scipy                 : 1.14.1
sqlalchemy            : 2.0.32
tables                : 3.10.1
tabulate              : None
xarray                : 2024.7.0
xlrd                  : 2.0.1
zstandard             : None
tzdata                : 2023.3
qtpy                  : None
pyqt5                 : None

</details>


Discussion:

Patch:
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
index 7245f0e6..ebf190cd 100644
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -1714,6 +1714,29 @@ class Series(BasePandasDataset):
             mapper=mapper, index=index, axis=axis, copy=copy, inplace=inplace
         )
 
+    def _set_axis_name(self, name, axis=0, inplace=False) -> Union[Series, None]:
+        """
+        Alter the name of the axis.
+
+        Parameters
+        ----------
+        name : str
+            Name for the Series.
+        axis : str or int, default: 0
+            The axis to set the label.
+            Only 0 is valid for Series.
+        inplace : bool, default: False
+            Whether to modify `self` directly or return a copy.
+
+        Returns
+        -------
+        Series or None
+        """
+        self._get_axis_number(axis)  # raises ValueError if not 0
+        renamed = self if inplace else self.copy()
+        renamed.index = renamed.index.set_names(name)
+        return None if inplace else renamed
+
     def rename(
         self,
         index=None,


Test patch:
diff --git a/modin/tests/pandas/test_series.py b/modin/tests/pandas/test_series.py
index f4821c93..828cc158 100644
--- a/modin/tests/pandas/test_series.py
+++ b/modin/tests/pandas/test_series.py
@@ -5197,3 +5197,21 @@ def test_argmax_argmin_7413(op):
     result_md = getattr(series_md, op)()
     result_pd = getattr(series_pd, op)()
     assert result_md == result_pd
+
+
+def test_rename_axis():
+    series_md, series_pd = create_test_series([0, 1, 2])
+    eval_general(series_md, series_pd, lambda ser: ser.rename_axis("name"))
+    eval_general(
+        series_md,
+        series_pd,
+        lambda ser: ser.rename_axis("new_name", inplace=True),
+        __inplace__=True,
+    )
+    # axis=1 is invalid for series
+    eval_general(
+        series_md,
+        series_pd,
+        lambda ser: ser.rename_axis("newer_name", axis=1),
+        expected_exception=ValueError("No axis named 1 for object type Series"),
+    )