code: def test_group_by_partitioned_ending_cast(monkeypatch: Any) -> None:
      monkeypatch.setenv("POLARS_FORCE_PARTITION", "1")
      df = pl.DataFrame({"a": [1] * 5, "b": [1] * 5})
      out = df.group_by(["a", "b"]).agg(
          pl.count().cast(pl.Int64).alias("num")
      )
      expected = pl.DataFrame({"a": [1], "b": [1], "num": [5]})
      assert_frame_equal(out, 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 28 for calling a global function with example usage: test_group_by_partitioned_ending_cast(monkeypatch) without return types