code: def test_nested_aggregation_window_expression() -> None:
      df = pl.DataFrame(
          {
              "x": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  11,
                  2,
                  13,
                  4,
                  15,
                  6,
                  None,
                  None,
                  19,
              ],
              "y": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
              ],
          }
      )
  
      result = df.with_columns(
          pl.when(pl.col("x") >= pl.col("x").quantile(0.1))
          .then(1)
          .otherwise(None)
          .over("y")
          .alias("foo")
      )
      expected = pl.DataFrame(
          {
              "x": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  11,
                  2,
                  13,
                  4,
                  15,
                  6,
                  None,
                  None,
                  19,
              ],
              "y": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
              ],
              "foo": [
                  None,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  1,
                  None,
                  1,
                  1,
                  1,
                  1,
                  None,
                  None,
                  1,
              ],
          },
          # Resulting column is Int32, see https://github.com/pola-rs/polars/issues/8041
          schema_overrides={"foo": pl.Int32},
      )
      assert_frame_equal(result, expected)
  
imports: from __future__ import annotations
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_nested_aggregation_window_expression() without return types