code: def test_sql_left() -> None:
      df = pl.DataFrame({"scol": ["abcde", "abc", "a", None]})
      ctx = pl.SQLContext(df=df)
      res = ctx.execute(
          'SELECT scol, LEFT(scol,2) AS "scol:left2" FROM df',
      ).collect()
  
      assert res.to_dict(as_series=False) == {
          "scol": ["abcde", "abc", "a", None],
          "scol:left2": ["ab", "ab", "a", None],
      }
      with pytest.raises(
          InvalidOperationError,
          match="Invalid 'length' for Left: 'xyz'",
      ):
          ctx.execute(
              """SELECT scol, LEFT(scol,'xyz') AS "scol:left2" FROM df"""
          ).collect()
  
imports: from __future__ import annotations
  import datetime
  import math
  from pathlib import Path
  import pytest
  import polars
  import polars.selectors
  from polars.exceptions import ComputeError, InvalidOperationError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_sql_left() without return types