code: def test_boolean_min_max_agg() -> None:
      np.random.seed(0)
      idx = np.random.randint(0, 500, 1000)
      c = np.random.randint(0, 500, 1000) > 250
  
      df = pl.DataFrame({"idx": idx, "c": c})
      aggs = [
          pl.col("c").min().alias("c_min"),
          pl.col("c").max().alias("c_max"),
      ]
  
      result = df.group_by("idx").agg(aggs).sum()
  
      schema = {"idx": pl.Int64, "c_min": pl.UInt32, "c_max": pl.UInt32}
      expected = pl.DataFrame(
          {
              "idx": [107583],
              "c_min": [120],
              "c_max": [321],
          },
          schema=schema,
      )
      assert_frame_equal(result, expected)
  
      nulls = np.random.randint(0, 500, 1000) < 100
  
      result = (
          df.with_columns(
              c=pl.when(pl.lit(nulls)).then(None).otherwise(pl.col("c"))
          )
          .group_by("idx")
          .agg(aggs)
          .sum()
      )
  
      expected = pl.DataFrame(
          {
              "idx": [107583],
              "c_min": [133],
              "c_max": [276],
          },
          schema=schema,
      )
      assert_frame_equal(result, expected)
  
file_path: polars/py-polars/tests/benchmark/test_release.py
imports: import time
  from pathlib import Path
  from typing import cast
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_boolean_min_max_agg() without return types