code: def test_unset_sorted_on_append() -> None:
      df1 = pl.DataFrame(
          [
              pl.Series(
                  "key", ["a", "b", "a", "b"], dtype=pl.Categorical
              ),
              pl.Series("val", [1, 2, 3, 4]),
          ]
      ).sort("key")
      df2 = pl.DataFrame(
          [
              pl.Series(
                  "key", ["a", "b", "a", "b"], dtype=pl.Categorical
              ),
              pl.Series("val", [5, 6, 7, 8]),
          ]
      ).sort("key")
      df = pl.concat([df1, df2], rechunk=False)
      assert df.group_by("key").count()["count"].to_list() == [4, 4]
  
imports: from __future__ import annotations
  import contextlib
  import io
  import operator
  from typing import TYPE_CHECKING, Any, Callable, Literal
  import pytest
  import polars
  from polars import StringCache
  from polars.exceptions import CategoricalRemappingWarning, StringCacheMismatchError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_unset_sorted_on_append() without return types