code: def map_in_pandas_example(spark: SparkSession) -> None:
      df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age"))
  
      def filter_func(
          iterator: Iterable[pd.DataFrame],
      ) -> Iterable[pd.DataFrame]:
          for pdf in iterator:
              yield pdf[pdf.id == 1]
  
      df.mapInPandas(filter_func, schema=df.schema).show()
  
file_path: spark/examples/src/main/python/sql/arrow.py
imports: import pandas
  from typing import Iterable
  from pyspark.sql import SparkSession
  from pyspark.sql.pandas.utils import require_minimum_pandas_version, require_minimum_pyarrow_version
label_desc: Use image node_id 8 for calling a global function with example usage: map_in_pandas_example(spark) without return types