code: def test_group_by_with_expr_as_key() -> None:
      gb = pl.select(x=1).group_by(pl.col("x").alias("key"))
      result = gb.agg(pl.all().first())
      expected = gb.agg(pl.first("x"))
      assert_frame_equal(result, expected)
  
      # tests: 11766
      result = gb.head(0)
      expected = gb.agg(pl.col("x").head(0)).explode("x")
      assert_frame_equal(result, expected)
  
      result = gb.tail(0)
      expected = gb.agg(pl.col("x").tail(0)).explode("x")
      assert_frame_equal(result, expected)
  
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 34 for calling a global function with example usage: test_group_by_with_expr_as_key() without return types