code: def test_to_csv(self):
      pdf = pd.DataFrame(
          {"aa": [1, 2, 3], "bb": [4, 5, 6]}, index=[0, 1, 3]
      )
      psdf = ps.DataFrame(pdf)
  
      self.assert_eq(psdf.to_csv(), pdf.to_csv(index=False))
      self.assert_eq(
          psdf.to_csv(columns=["aa"]),
          pdf.to_csv(columns=["aa"], index=False),
      )
      self.assert_eq(
          psdf.aa.to_csv(), pdf.aa.to_csv(index=False, header=True)
      )
  
      pdf = pd.DataFrame(
          {"a": [1, np.nan, 3], "b": ["one", "two", None]},
          index=[0, 1, 3],
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.to_csv(na_rep="null"),
          pdf.to_csv(na_rep="null", index=False),
      )
      self.assert_eq(
          psdf.a.to_csv(na_rep="null"),
          pdf.a.to_csv(na_rep="null", index=False, header=True),
      )
  
      self.assertRaises(KeyError, lambda: psdf.to_csv(columns=["ab"]))
  
      pdf = pd.DataFrame(
          {"a": [1.0, 2.0, 3.0], "b": [4.0, 5.0, 6.0]}, index=[0, 1, 3]
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(psdf.to_csv(), pdf.to_csv(index=False))
      self.assert_eq(
          psdf.to_csv(header=False),
          pdf.to_csv(header=False, index=False),
      )
      self.assert_eq(psdf.to_csv(), pdf.to_csv(index=False))
  
      # non-string names
      pdf = pd.DataFrame(
          {10: [1, 2, 3], 20: [4, 5, 6]}, index=[0, 1, 3]
      )
      psdf = ps.DataFrame(pdf)
  
      self.assert_eq(psdf.to_csv(), pdf.to_csv(index=False))
      self.assert_eq(
          psdf.to_csv(columns=[10]),
          pdf.to_csv(columns=[10], index=False),
      )
  
      self.assertRaises(TypeError, lambda: psdf.to_csv(columns=10))
  
imports: import os
  from contextlib import contextmanager
  import pandas
  import numpy
  from pyspark import pandas
  from pyspark.testing.pandasutils import PandasOnSparkTestCase, TestUtils
label_desc: Use image node_id 18 for calling the CsvTestsMixin obj's underlying member method code with example usage: obj.test_to_csv() without return types