code: def test_group_by_when_then_no_aggregation_predicate() -> None:
      df = pl.DataFrame(
          {
              "key": ["aa", "aa", "bb", "bb", "aa", "aa"],
              "val": [-3, -2, 1, 4, -3, 5],
          }
      )
      assert df.group_by("key").agg(
          pos=pl.when(pl.col("val") >= 0).then(pl.col("val")).sum(),
          neg=pl.when(pl.col("val") < 0).then(pl.col("val")).sum(),
      ).sort("key").to_dict(as_series=False) == {
          "key": ["aa", "bb"],
          "pos": [5, 5],
          "neg": [-8, 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 37 for calling a global function with example usage: test_group_by_when_then_no_aggregation_predicate() without return types