code: def test_decimal_aggregations() -> None:
      df = pl.DataFrame(
          {
              "g": [1, 1, 2, 2],
              "a": [D("0.1"), D("10.1"), D("100.01"), D("9000.12")],
          }
      )
  
      assert df.group_by("g", maintain_order=True).agg(
          sum=pl.sum("a"),
          min=pl.min("a"),
          max=pl.max("a"),
      ).to_dict(as_series=False) == {
          "g": [1, 2],
          "sum": [D("10.20"), D("9100.13")],
          "min": [D("0.10"), D("100.01")],
          "max": [D("10.10"), D("9000.12")],
      }
  
      assert df.select(
          sum=pl.sum("a"),
          min=pl.min("a"),
          max=pl.max("a"),
      ).to_dict(as_series=False) == {
          "sum": [D("9110.33")],
          "min": [D("0.10")],
          "max": [D("9000.12")],
      }
  
imports: from __future__ import annotations
  import io
  import itertools
  from dataclasses import dataclass
  from decimal import Decimal
  from typing import Any, NamedTuple
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_decimal_aggregations() without return types