code: def test_tree_validation_streaming() -> None:
      # this query leads to a tree collection with an invalid branch
      # this test triggers the tree validation function.
      df_1 = pl.DataFrame(
          {
              "a": [22, 1, 1],
              "b": [500, 37, 20],
          },
      ).lazy()
  
      df_2 = pl.DataFrame(
          {"a": [23, 4, 20, 28, 3]},
      ).lazy()
  
      dfs = [df_2]
      cat = pl.concat(dfs, how="vertical")
  
      df_3 = df_1.select(
          [
              "a",
              # this expression is not allowed streaming, so it invalidates a branch
              pl.col("b")
              .filter(pl.col("a").min() > pl.col("a").rank())
              .alias("b_not_streaming"),
          ]
      ).join(
          cat,
          on=[
              "a",
          ],
      )
  
      out = df_1.join(df_3, on="a", how="left")
      assert out.collect(streaming=True).shape == (3, 3)
  
imports: from __future__ import annotations
  import os
  import tempfile
  import time
  from datetime import date
  from pathlib import Path
  from typing import TYPE_CHECKING, Any
  import numpy
  import pytest
  import polars
  from polars.exceptions import PolarsInefficientMapWarning
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_tree_validation_streaming() without return types