code: def test_corrwith(self):
      df1 = ps.DataFrame(
          {
              "A": [1, np.nan, 7, 8],
              "B": [False, True, True, False],
              "C": [10, 4, 9, 3],
          }
      )
      df2 = df1[["A", "C"]]
      df3 = df1[["B", "C"]]
      self._test_corrwith(df1, df2)
      self._test_corrwith(df1, df3)
      self._test_corrwith((df1 + 1), df2.A)
      self._test_corrwith((df1 + 1), df3.B)
      self._test_corrwith((df1 + 1), (df2.C + 2))
      self._test_corrwith((df1 + 1), (df3.B + 2))
  
      with self.assertRaisesRegex(TypeError, "unsupported type"):
          df1.corrwith(123)
      with self.assertRaisesRegex(
          NotImplementedError, "only works for axis=0"
      ):
          df1.corrwith(df1.A, axis=1)
      with self.assertRaisesRegex(ValueError, "Invalid method"):
          df1.corrwith(df1.A, method="cov")
  
      df_bool = ps.DataFrame(
          {
              "A": [True, True, False, False],
              "B": [True, False, False, True],
          }
      )
      self._test_corrwith(df_bool, df_bool.A)
      self._test_corrwith(df_bool, df_bool.B)
  
file_path: spark/python/pyspark/pandas/tests/computation/test_corrwith.py
imports: import unittest
  import numpy
  from pyspark import pandas
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 1 for calling the FrameCorrwithMixin obj's underlying member method code with example usage: obj.test_corrwith() without return types