code: def test_pre_transform_spec_encoded_datasets():
      # Pre-transform with supported aggregate function should result in no warnings
      vega_spec = movies_histogram_spec()
  
      # default list of dict format
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          vega_spec,
          data_encoding_threshold=10,
          data_encoding_format="pyarrow",
      )
  
      values = tx_spec["data"][0]["values"]
      assert isinstance(values, list)
      assert len(values) == 9
  
      # pyarrow format
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          vega_spec,
          data_encoding_threshold=0,
          data_encoding_format="pyarrow",
      )
  
      values = tx_spec["data"][0]["values"]
      assert isinstance(values, pa.Table)
      values_df = values.to_pandas()
      assert len(values_df) == 9
      assert values_df.columns[0] == "bin_maxbins_10_IMDB Rating"
  
      # arrow-ipc format
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          vega_spec,
          data_encoding_threshold=0,
          data_encoding_format="arrow-ipc",
      )
  
      values = tx_spec["data"][0]["values"]
      assert isinstance(values, bytes)
      values_df = pa.ipc.deserialize_pandas(values)
      assert len(values_df) == 9
      assert values_df.columns[0] == "bin_maxbins_10_IMDB Rating"
  
      # arrow-ipc-base64 format
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          vega_spec,
          data_encoding_threshold=0,
          data_encoding_format="arrow-ipc-base64",
      )
  
      values = tx_spec["data"][0]["values"]
      assert isinstance(values, str)
      values_df = pa.ipc.deserialize_pandas(
          base64.standard_b64decode(values)
      )
      assert len(values_df) == 9
      assert values_df.columns[0] == "bin_maxbins_10_IMDB Rating"
  
imports: import pandas
  import pytest
  from pandas import Timestamp, NaT
  import pyarrow
  import vegafusion
  import json
  import polars
  from datetime import date
  import decimal
  import base64
label_desc: Use image node_id 31 for calling a global function with example usage: test_pre_transform_spec_encoded_datasets() without return types