code: def test_sort_aggregation_fast_paths() -> None:
      df = pl.DataFrame(
          {
              "a": [None, 3, 2, 1],
              "b": [3, 2, 1, None],
              "c": [3, None, None, None],
              "e": [None, None, None, 1],
              "f": [1, 2, 5, 1],
          }
      )
  
      expected = df.select(
          [
              pl.all().max().name.suffix("_max"),
              pl.all().min().name.suffix("_min"),
          ]
      )
  
      assert expected.to_dict(as_series=False) == {
          "a_max": [3],
          "b_max": [3],
          "c_max": [3],
          "e_max": [1],
          "f_max": [5],
          "a_min": [1],
          "b_min": [1],
          "c_min": [3],
          "e_min": [1],
          "f_min": [1],
      }
  
      for descending in [True, False]:
          for null_last in [True, False]:
              out = df.select(
                  [
                      pl.all()
                      .sort(descending=descending, nulls_last=null_last)
                      .max()
                      .name.suffix("_max"),
                      pl.all()
                      .sort(descending=descending, nulls_last=null_last)
                      .min()
                      .name.suffix("_min"),
                  ]
              )
              assert_frame_equal(out, expected)
  
imports: from __future__ import annotations
  from datetime import date, datetime
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_sort_aggregation_fast_paths() without return types