code: def test_batch_mapper_basic(ray_start_regular_shared):
      """Tests batch mapper functionality."""
      old_column = [1, 2, 3, 4]
      to_be_modified = [1, -1, 1, -1]
      in_df = pd.DataFrame.from_dict(
          {"old_column": old_column, "to_be_modified": to_be_modified}
      )
      ds = ray.data.from_pandas(in_df)
  
      def add_and_modify_udf(df: "pd.DataFrame"):
          df["new_col"] = df["old_column"] + 1
          df["to_be_modified"] *= 2
          return df
  
      batch_mapper = BatchMapper(
          fn=add_and_modify_udf, batch_format="pandas"
      )
      batch_mapper.fit(ds)
      transformed = batch_mapper.transform(ds)
      out_df = transformed.to_pandas()
  
      expected_df = pd.DataFrame.from_dict(
          {
              "old_column": old_column,
              "to_be_modified": [2, -2, 2, -2],
              "new_col": [2, 3, 4, 5],
          }
      )
  
      assert out_df.equals(expected_df)
  
file_path: ray/python/ray/data/tests/preprocessors/test_batch_mapper.py
imports: from typing import Dict
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.preprocessors import BatchMapper
  from ray.tests.conftest import *
label_desc: Use image node_id 1 for calling a global function with example usage: test_batch_mapper_basic(ray_start_regular_shared) and returns: df