code: def test_dataframe(self):
      pdf, psdf = self.df_pair
  
      self.assert_eq(psdf["a"] + 1, pdf["a"] + 1)
  
      self.assert_eq(psdf.columns, pd.Index(["a", "b"]))
  
      self.assert_eq(psdf[psdf["b"] > 2], pdf[pdf["b"] > 2])
      self.assert_eq(-psdf[psdf["b"] > 2], -pdf[pdf["b"] > 2])
      self.assert_eq(psdf[["a", "b"]], pdf[["a", "b"]])
      self.assert_eq(psdf.a, pdf.a)
      self.assert_eq(psdf.b.mean(), pdf.b.mean())
      self.assert_eq(psdf.b.var(), pdf.b.var())
      self.assert_eq(psdf.b.std(), pdf.b.std())
  
      pdf, psdf = self.df_pair
      self.assert_eq(psdf[["a", "b"]], pdf[["a", "b"]])
  
      self.assertEqual(psdf.a.notnull().rename("x").name, "x")
  
      # check ps.DataFrame(ps.Series)
      pser = pd.Series([1, 2, 3], name="x", index=np.random.rand(3))
      psser = ps.from_pandas(pser)
      self.assert_eq(pd.DataFrame(pser), ps.DataFrame(psser))
  
      # check ps.DataFrame(ps.Series) with `columns`
      self.assert_eq(
          pd.DataFrame(pser, columns=["x"]),
          ps.DataFrame(psser, columns=["x"]),
      )
      self.assert_eq(
          pd.DataFrame(pser, columns=("x",)),
          ps.DataFrame(psser, columns=("x",)),
      )
      self.assert_eq(
          pd.DataFrame(pser, columns={"x": None}),
          ps.DataFrame(psser, columns={"x": None}),
      )
  
      # check psdf[pd.Index]
      pdf, psdf = self.df_pair
      column_mask = pdf.columns.isin(["a", "b"])
      index_cols = pdf.columns[column_mask]
      self.assert_eq(psdf[index_cols], pdf[index_cols])
  
      if is_testing():
          err_msg = "pandas-on-Spark doesn't allow columns to be created via a new attribute name"
          with self.assertRaisesRegex(AssertionError, err_msg):
              psdf.X = [10, 20, 30, 40, 50, 60, 70, 80, 90]
      else:
          with self.assertWarns(UserWarning):
              psdf.X = [10, 20, 30, 40, 50, 60, 70, 80, 90]
          # If a new column is created, the following test would fail.
          # It means that the pandas have changed their behavior, so we should follow.
          self.assert_eq(pdf, psdf)
  
imports: from datetime import datetime, timedelta
  import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.pandas.typedef.typehints import extension_dtypes_available, extension_float_dtypes_available, extension_object_dtypes_available
  from pyspark.pandas.utils import is_testing
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 3 for calling the FrameConstructorMixin obj's underlying member method code with example usage: obj.test_dataframe() without return types