code: def test_group_by_sorted_empty_dataframe_3680() -> None:
      df = (
          pl.DataFrame(
              [
                  pl.Series("key", [], dtype=pl.Categorical),
                  pl.Series("val", [], dtype=pl.Float64),
              ]
          )
          .lazy()
          .sort("key")
          .group_by("key")
          .tail(1)
          .collect()
      )
      assert df.rows() == []
      assert df.shape == (0, 2)
      assert df.schema == {"key": pl.Categorical, "val": pl.Float64}
  
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 10 for calling a global function with example usage: test_group_by_sorted_empty_dataframe_3680() without return types