code: def test_explicit_list_agg_sort_in_group_by() -> None:
      df = pl.DataFrame(
          {"A": ["a", "a", "a", "b", "b", "a"], "B": [1, 2, 3, 4, 5, 6]}
      )
  
      # this was col().implode().sort() before we changed the logic
      result = (
          df.group_by("A")
          .agg(pl.col("B").sort(descending=True))
          .sort("A")
      )
      expected = (
          df.group_by("A")
          .agg(pl.col("B").sort(descending=True))
          .sort("A")
      )
      assert_frame_equal(result, 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 18 for calling a global function with example usage: test_explicit_list_agg_sort_in_group_by() without return types