code: def test_schema_on_agg() -> None:
      df = pl.DataFrame({"a": ["x", "x", "y", "n"], "b": [1, 2, 3, 4]})
  
      assert (
          df.lazy()
          .group_by("a")
          .agg(
              [
                  pl.col("b").min().alias("min"),
                  pl.col("b").max().alias("max"),
                  pl.col("b").sum().alias("sum"),
                  pl.col("b").first().alias("first"),
                  pl.col("b").last().alias("last"),
              ]
          )
      ).schema == {
          "a": pl.String,
          "min": pl.Int64,
          "max": pl.Int64,
          "sum": pl.Int64,
          "first": pl.Int64,
          "last": pl.Int64,
      }
  
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 2 for calling a global function with example usage: test_schema_on_agg() without return types