code: def test_struct_with_lit() -> None:
      expr = pl.struct([pl.col("a"), pl.lit(1).alias("b")])
  
      assert (
          pl.DataFrame({"a": pl.Series([], dtype=pl.Int64)})
          .select(expr)
          .to_dict(as_series=False)
      ) == {"a": []}
  
      assert (
          pl.DataFrame({"a": pl.Series([1], dtype=pl.Int64)})
          .select(expr)
          .to_dict(as_series=False)
      ) == {"a": [{"a": 1, "b": 1}]}
  
      assert (
          pl.DataFrame({"a": pl.Series([1, 2], dtype=pl.Int64)})
          .select(expr)
          .to_dict(as_series=False)
      ) == {"a": [{"a": 1, "b": 1}, {"a": 2, "b": 1}]}
  
imports: from __future__ import annotations
  from datetime import date, datetime
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 17 for calling a global function with example usage: test_struct_with_lit() without return types