code: def test_rename_columns(self):
      pdf = pd.DataFrame(
          {"a": [1, 2, 3, 4, 5, 6, 7], "b": [7, 6, 5, 4, 3, 2, 1]},
          index=np.random.rand(7),
      )
      psdf = ps.from_pandas(pdf)
  
      psdf.columns = ["x", "y"]
      pdf.columns = ["x", "y"]
      self.assert_eq(psdf.columns, pd.Index(["x", "y"]))
      self.assert_eq(psdf, pdf)
      self.assert_eq(psdf._internal.data_spark_column_names, ["x", "y"])
      self.assert_eq(psdf.to_spark().columns, ["x", "y"])
      self.assert_eq(
          psdf.to_spark(index_col="index").columns, ["index", "x", "y"]
      )
  
      columns = pdf.columns
      columns.name = "lvl_1"
  
      psdf.columns = columns
      self.assert_eq(psdf.columns.names, ["lvl_1"])
      self.assert_eq(psdf, pdf)
  
      msg = "Length mismatch: Expected axis has 2 elements, new values have 4 elements"
      with self.assertRaisesRegex(ValueError, msg):
          psdf.columns = [1, 2, 3, 4]
  
      # Multi-index columns
      pdf = pd.DataFrame(
          {("A", "0"): [1, 2, 2, 3], ("B", "1"): [1, 2, 3, 4]},
          index=np.random.rand(4),
      )
      psdf = ps.from_pandas(pdf)
  
      columns = pdf.columns
      self.assert_eq(psdf.columns, columns)
      self.assert_eq(psdf, pdf)
  
      pdf.columns = ["x", "y"]
      psdf.columns = ["x", "y"]
      self.assert_eq(psdf.columns, pd.Index(["x", "y"]))
      self.assert_eq(psdf, pdf)
      self.assert_eq(psdf._internal.data_spark_column_names, ["x", "y"])
      self.assert_eq(psdf.to_spark().columns, ["x", "y"])
      self.assert_eq(
          psdf.to_spark(index_col="index").columns, ["index", "x", "y"]
      )
  
      pdf.columns = columns
      psdf.columns = columns
      self.assert_eq(psdf.columns, columns)
      self.assert_eq(psdf, pdf)
      self.assert_eq(
          psdf._internal.data_spark_column_names, ["(A, 0)", "(B, 1)"]
      )
      self.assert_eq(psdf.to_spark().columns, ["(A, 0)", "(B, 1)"])
      self.assert_eq(
          psdf.to_spark(index_col="index").columns,
          ["index", "(A, 0)", "(B, 1)"],
      )
  
      columns.names = ["lvl_1", "lvl_2"]
  
      psdf.columns = columns
      self.assert_eq(psdf.columns.names, ["lvl_1", "lvl_2"])
      self.assert_eq(psdf, pdf)
      self.assert_eq(
          psdf._internal.data_spark_column_names, ["(A, 0)", "(B, 1)"]
      )
      self.assert_eq(psdf.to_spark().columns, ["(A, 0)", "(B, 1)"])
      self.assert_eq(
          psdf.to_spark(index_col="index").columns,
          ["index", "(A, 0)", "(B, 1)"],
      )
  
imports: from datetime import datetime
  import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 4 for calling the FrameAttrsMixin obj's underlying member method code with example usage: obj.test_rename_columns() without return types