code: def test_error_on_reducing_map() -> None:
      df = pl.DataFrame(
          {
              "id": [0, 0, 0, 1, 1, 1],
              "t": [2, 4, 5, 10, 11, 14],
              "y": [0, 1, 1, 2, 3, 4],
          }
      )
      with pytest.raises(
          pl.InvalidOperationError,
          match=(
              r"output length of `map` \(6\) must be equal to "
              r"the input length \(1\); consider using `apply` instead"
          ),
      ):
          df.group_by("id").agg(pl.map_batches(["t", "y"], np.trapz))
  
      df = pl.DataFrame({"x": [1, 2, 3, 4], "group": [1, 2, 1, 2]})
      with pytest.raises(
          pl.InvalidOperationError,
          match=(
              r"output length of `map` \(4\) must be equal to "
              r"the input length \(1\); consider using `apply` instead"
          ),
      ):
          df.select(
              pl.col("x")
              .map_batches(
                  lambda x: x.cut(
                      breaks=[1, 2, 3], include_breaks=True
                  ).struct.unnest(),
                  is_elementwise=True,
              )
              .over("group")
          )
  
imports: from __future__ import annotations
  import io
  from datetime import date, datetime, time
  from decimal import Decimal
  from typing import TYPE_CHECKING, Any
  import numpy
  import pytest
  import polars
  from polars.datatypes.convert import dtype_to_py_type
  from polars.exceptions import InvalidOperationError
label_desc: Use image node_id 2 for calling a global function with example usage: test_error_on_reducing_map() without return types