code: def do_test_apply_in_arrow(self, cogrouped_df, key_column="id"):
      schema = "metric string, left long, right long"
  
      # compare with result of applyInPandas
      expected = cogrouped_df.applyInPandas(
          CogroupedMapInArrowTestsMixin.apply_in_pandas_with_key_func(
              key_column
          ),
          schema,
      )
  
      # apply in arrow without key
      actual = cogrouped_df.applyInArrow(
          CogroupedMapInArrowTestsMixin.apply_in_arrow_func, schema
      ).collect()
      self.assertEqual(actual, expected.collect())
  
      # apply in arrow with key
      actual2 = cogrouped_df.applyInArrow(
          CogroupedMapInArrowTestsMixin.apply_in_arrow_with_key_func(
              key_column
          ),
          schema,
      ).collect()
      self.assertEqual(actual2, expected.collect())
  
imports: import os
  import time
  import unittest
  from pyspark.errors import PythonException
  from pyspark.sql import Row
  from pyspark.sql.functions import col
  from pyspark.testing.sqlutils import ReusedSQLTestCase, have_pyarrow, pyarrow_requirement_message
  from pyspark.testing.utils import QuietTest
label_desc: Use image node_id 7 for calling the CogroupedMapInArrowTestsMixin obj's underlying member method code with example usage: obj.do_test_apply_in_arrow(cogrouped_df, key_column) without return types