code: def test_categorical_collect_11408() -> None:
      df = pl.DataFrame(
          data={
              "groups": ["a", "b", "c"],
              "cats": ["a", "b", "c"],
              "amount": [1, 2, 3],
          },
          schema={
              "groups": pl.String,
              "cats": pl.Categorical,
              "amount": pl.Int8,
          },
      )
  
      assert df.group_by("groups").agg(
          pl.col("cats")
          .filter(pl.col("amount") == pl.col("amount").min())
          .first()
      ).sort("groups").to_dict(as_series=False) == {
          "groups": ["a", "b", "c"],
          "cats": ["a", "b", "c"],
      }
  
imports: from __future__ import annotations
  import contextlib
  import io
  import operator
  from typing import TYPE_CHECKING, Any, Callable, Literal
  import pytest
  import polars
  from polars import StringCache
  from polars.exceptions import CategoricalRemappingWarning, StringCacheMismatchError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 36 for calling a global function with example usage: test_categorical_collect_11408() without return types