code: def test_to_series(self):
      pidx = self.pdf.index
      psidx = self.psdf.index
  
      self.assert_eq(psidx.to_series(), pidx.to_series())
      self.assert_eq(
          psidx.to_series(name="a"), pidx.to_series(name="a")
      )
  
      # With name
      pidx.name = "Koalas"
      psidx.name = "Koalas"
      self.assert_eq(psidx.to_series(), pidx.to_series())
      self.assert_eq(
          psidx.to_series(name=("x", "a")),
          pidx.to_series(name=("x", "a")),
      )
  
      # With tupled name
      pidx.name = ("x", "a")
      psidx.name = ("x", "a")
      self.assert_eq(psidx.to_series(), pidx.to_series())
      self.assert_eq(
          psidx.to_series(name="a"), pidx.to_series(name="a")
      )
  
      self.assert_eq((psidx + 1).to_series(), (pidx + 1).to_series())
  
      pidx = self.pdf.set_index("b", append=True).index
      psidx = self.psdf.set_index("b", append=True).index
  
      with self.sql_conf({SPARK_CONF_ARROW_ENABLED: False}):
          self.assert_eq(psidx.to_series(), pidx.to_series())
          self.assert_eq(
              psidx.to_series(name="a"), pidx.to_series(name="a")
          )
  
      expected_error_message = "Series.name must be a hashable type"
      with self.assertRaisesRegex(TypeError, expected_error_message):
          psidx.to_series(name=["x", "a"])
  
imports: import unittest
  from datetime import datetime
  import pandas
  from pyspark import pandas
  from pyspark.loose_version import LooseVersion
  from pyspark.testing.pandasutils import PandasOnSparkTestCase, SPARK_CONF_ARROW_ENABLED
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 10 for calling the ConversionMixin obj's underlying member method code with example usage: obj.test_to_series() without return types