code: def test_when_then_broadcast_nulls_12665() -> None:
      df = pl.DataFrame(
          {
              "val": [1, 2, 3, 4],
              "threshold": [4, None, None, 1],
          }
      )
  
      assert df.select(
          when=pl.when(pl.col("val") > pl.col("threshold"))
          .then(1)
          .otherwise(0),
      ).to_dict(as_series=False) == {"when": [0, 0, 0, 1]}
  
imports: from __future__ import annotations
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_when_then_broadcast_nulls_12665() without return types