code: def test_stopiteration_in_grouped_map(self):
      def foo(x):
          raise StopIteration()
  
      def foofoo(x, y):
          raise StopIteration()
  
      exc_message = "StopIteration"
      df = self.spark.range(0, 100)
  
      # pandas grouped map
      self.assertRaisesRegex(
          PythonException,
          exc_message,
          df.groupBy("id")
          .apply(pandas_udf(foo, df.schema, PandasUDFType.GROUPED_MAP))
          .collect,
      )
  
      self.assertRaisesRegex(
          PythonException,
          exc_message,
          df.groupBy("id")
          .apply(
              pandas_udf(foofoo, df.schema, PandasUDFType.GROUPED_MAP)
          )
          .collect,
      )
  
imports: import unittest
  import datetime
  from typing import cast
  from pyspark.sql.functions import udf, pandas_udf, PandasUDFType, assert_true, lit
  from pyspark.sql.types import DoubleType, StructType, StructField, LongType, DayTimeIntervalType
  from pyspark.errors import ParseException, PythonException, PySparkTypeError
  from pyspark.rdd import PythonEvalType
  from pyspark.testing.sqlutils import ReusedSQLTestCase, have_pandas, have_pyarrow, pandas_requirement_message, pyarrow_requirement_message
  from pyspark.testing.utils import QuietTest
label_desc: Use image node_id 8 for calling the PandasUDFTestsMixin obj's underlying member method code with example usage: obj.test_stopiteration_in_grouped_map() without return types