code: def test_append(self):
      # Index
      pidx = pd.Index(range(10000))
      psidx = ps.from_pandas(pidx)
  
      self.assert_eq(pidx.append(pidx), psidx.append(psidx))
  
      # Index with name
      pidx1 = pd.Index(range(10000), name="a")
      pidx2 = pd.Index(range(10000), name="b")
      psidx1 = ps.from_pandas(pidx1)
      psidx2 = ps.from_pandas(pidx2)
  
      self.assert_eq(pidx1.append(pidx2), psidx1.append(psidx2))
  
      self.assert_eq(pidx2.append(pidx1), psidx2.append(psidx1))
  
      # Index from DataFrame
      pdf1 = pd.DataFrame(
          {"a": [1, 2, 3], "b": [4, 5, 6]}, index=["a", "b", "c"]
      )
      pdf2 = pd.DataFrame(
          {"a": [7, 8, 9], "d": [10, 11, None]}, index=["x", "y", "z"]
      )
      psdf1 = ps.from_pandas(pdf1)
      psdf2 = ps.from_pandas(pdf2)
  
      pidx1 = pdf1.set_index("a").index
      pidx2 = pdf2.set_index("d").index
      psidx1 = psdf1.set_index("a").index
      psidx2 = psdf2.set_index("d").index
  
      self.assert_eq(pidx1.append(pidx2), psidx1.append(psidx2))
  
      self.assert_eq(pidx2.append(pidx1), psidx2.append(psidx1))
  
      # Index from DataFrame with MultiIndex columns
      pdf1 = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
      pdf2 = pd.DataFrame({"a": [7, 8, 9], "d": [10, 11, 12]})
      pdf1.columns = pd.MultiIndex.from_tuples([("a", "x"), ("b", "y")])
      pdf2.columns = pd.MultiIndex.from_tuples([("a", "x"), ("d", "y")])
      psdf1 = ps.from_pandas(pdf1)
      psdf2 = ps.from_pandas(pdf2)
  
      pidx1 = pdf1.set_index(("a", "x")).index
      pidx2 = pdf2.set_index(("d", "y")).index
      psidx1 = psdf1.set_index(("a", "x")).index
      psidx2 = psdf2.set_index(("d", "y")).index
  
      self.assert_eq(pidx1.append(pidx2), psidx1.append(psidx2))
  
      self.assert_eq(pidx2.append(pidx1), psidx2.append(psidx1))
  
      # MultiIndex
      pmidx = pd.MultiIndex.from_tuples(
          [("a", "x", 1), ("b", "y", 2), ("c", "z", 3)]
      )
      psmidx = ps.from_pandas(pmidx)
  
      self.assert_eq(pmidx.append(pmidx), psmidx.append(psmidx))
  
      # MultiIndex with names
      pmidx1 = pd.MultiIndex.from_tuples(
          [("a", "x", 1), ("b", "y", 2), ("c", "z", 3)],
          names=["x", "y", "z"],
      )
      pmidx2 = pd.MultiIndex.from_tuples(
          [("a", "x", 1), ("b", "y", 2), ("c", "z", 3)],
          names=["p", "q", "r"],
      )
      psmidx1 = ps.from_pandas(pmidx1)
      psmidx2 = ps.from_pandas(pmidx2)
  
      self.assert_eq(pmidx1.append(pmidx2), psmidx1.append(psmidx2))
      self.assert_eq(pmidx2.append(pmidx1), psmidx2.append(psmidx1))
      self.assert_eq(
          pmidx1.append(pmidx2).names, psmidx1.append(psmidx2).names
      )
  
      # Index & MultiIndex is currently not supported
      expected_error_message = r"append\(\) between Index & MultiIndex is currently not supported"
      with self.assertRaisesRegex(
          NotImplementedError, expected_error_message
      ):
          psidx.append(psmidx)
      with self.assertRaisesRegex(
          NotImplementedError, expected_error_message
      ):
          psmidx.append(psidx)
  
      # MultiIndexs with different levels is currently not supported
      psmidx3 = ps.MultiIndex.from_tuples(
          [("a", "x"), ("b", "y"), ("c", "z")]
      )
      expected_error_message = r"append\(\) between MultiIndexs with different levels is currently not supported"
      with self.assertRaisesRegex(
          NotImplementedError, expected_error_message
      ):
          psmidx.append(psmidx3)
  
file_path: spark/python/pyspark/pandas/tests/indexes/test_append.py
imports: import unittest
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 1 for calling the AppendMixin obj's underlying member method code with example usage: obj.test_append() without return types