code: def test_lazy_map_schema() -> None:
      df = pl.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
  
      # identity
      assert_frame_equal(
          df.lazy().map_batches(lambda x: x).collect(), df
      )
  
      def custom(df: pl.DataFrame) -> pl.Series:
          return df["a"]
  
      with pytest.raises(
          pl.ComputeError,
          match="Expected 'LazyFrame.map' to return a 'DataFrame', got a",
      ):
          df.lazy().map_batches(custom).collect()  # type: ignore[arg-type]
  
      def custom2(
          df: pl.DataFrame,
      ) -> pl.DataFrame:
          # changes schema
          return df.select(pl.all().cast(pl.String))
  
      with pytest.raises(
          pl.ComputeError,
          match="The output schema of 'LazyFrame.map' is incorrect. Expected",
      ):
          df.lazy().map_batches(custom2).collect()
  
      assert df.lazy().map_batches(
          custom2, validate_output_schema=False
      ).collect().to_dict(as_series=False) == {
          "a": ["1", "2", "3"],
          "b": ["a", "b", "c"],
      }
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from datetime import date, timedelta
  from typing import Any, Iterator, Mapping
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_lazy_map_schema() and returns: df, df