code: def test_apply_after_take_in_group_by_3869() -> None:
      assert (
          pl.DataFrame(
              {
                  "k": list("aaabbb"),
                  "t": [1, 2, 3, 4, 5, 6],
                  "v": [3, 1, 2, 5, 6, 4],
              }
          )
          .group_by("k", maintain_order=True)
          .agg(
              pl.col("v").get(pl.col("t").arg_max()).sqrt()
          )  # <- fails for sqrt, exp, log, pow, etc.
      ).to_dict(as_series=False) == {
          "k": ["a", "b"],
          "v": [1.4142135623730951, 2.0],
      }
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from datetime import datetime, timedelta
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_apply_after_take_in_group_by_3869() without return types