code: def test_map_groups_object_output() -> None:
      df = pl.DataFrame(
          {
              "names": ["foo", "ham", "spam", "cheese", "egg", "foo"],
              "dates": ["1", "1", "2", "3", "3", "4"],
              "groups": ["A", "A", "B", "B", "B", "C"],
          }
      )
  
      class Foo:
          def __init__(self, payload: Any):
              self.payload = payload
  
      result = df.group_by("groups").agg(
          pl.map_groups(
              [pl.col("dates"), pl.col("names")],
              lambda s: Foo(dict(zip(s[0], s[1]))),
          )
      )
  
      assert result.dtypes == [pl.String, pl.Object]
  
file_path: polars/py-polars/tests/unit/operations/map/test_map_groups.py
imports: from __future__ import annotations
  from typing import Any, Sequence
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_map_groups_object_output() without return types