code: def test_pickle_udf_expression() -> None:
      df = pl.DataFrame({"a": [1, 2, 3]})
  
      e = pl.col("a").map_batches(times2)
      b = pickle.dumps(e)
      e = pickle.loads(b)
  
      result = df.select(e)
      expected = pl.DataFrame({"a": [2, 4, 6]})
      assert_frame_equal(result, expected)
  
      e = pl.col("a").map_batches(times2, return_dtype=pl.String)
      b = pickle.dumps(e)
      e = pickle.loads(b)
  
      # tests that 'GetOutput' is also deserialized
      with pytest.raises(
          pl.SchemaError,
          match=r"expected output type 'String', got 'Int64'; set `return_dtype` to the proper datatype",
      ):
          df.select(e)
  
imports: from __future__ import annotations
  import io
  import pickle
  from datetime import datetime, timedelta
  import pytest
  import polars
  from polars import StringCache
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_pickle_udf_expression() without return types