code: def test_bool_eval_to_query(setup):
      raw = pd.DataFrame(
          np.random.rand(100, 10), columns=list("ABCDEFGHIJ")
      )
  
      # does not support non-eval inputs
      df1 = md.DataFrame(raw, chunk_size=10)
      df2 = df1[(df1["A"] * 5).astype(bool)]
      graph = TileableGraph([df2.data])
      next(TileableGraphBuilder(graph).build())
      records = optimize(graph)
      assert records.get_optimization_result(df2.data) is None
  
      df1 = md.DataFrame(raw, chunk_size=10)
      df2 = df1[(df1["A"] > 0.5) & (df1["C"] < 0.5)]
      graph = TileableGraph([df2.data])
      next(TileableGraphBuilder(graph).build())
      records = optimize(graph)
      opt_df2 = records.get_optimization_result(df2.data)
      assert isinstance(opt_df2.op, DataFrameEval)
      assert opt_df2.op.is_query
      assert (
          _norm_vars(opt_df2.op.expr)
          == "((`A`) > (@scalar)) & ((`C`) < (@scalar))"
      )
  
      pd.testing.assert_frame_equal(
          df2.execute().fetch(),
          raw[(raw["A"] > 0.5) & (raw["C"] < 0.5)],
      )
  
      raw = pd.DataFrame(
          np.random.rand(100, 10), columns=list("ABCDEFGHIJ")
      )
      df1 = md.DataFrame(raw, chunk_size=10)
      df2 = df1[(df1["A"] > 0.5) & (df1["C"] < 0.5)] + 1
      assert isinstance(opt_df2.op, DataFrameEval)
      assert opt_df2.op.is_query
  
      r_df2, _r_col_a = fetch(execute(df2, df1["A"]))
      pd.testing.assert_frame_equal(
          r_df2, raw[(raw["A"] > 0.5) & (raw["C"] < 0.5)] + 1
      )
  
      raw = pd.DataFrame(
          {
              "a": np.arange(100),
              "b": [
                  pd.Timestamp("2022-1-1") + pd.Timedelta(days=i)
                  for i in range(100)
              ],
          }
      )
      df1 = md.DataFrame(raw, chunk_size=10)
      df2 = df1[df1.b < pd.Timestamp("2022-3-20")]
      graph = TileableGraph([df2.data])
      next(TileableGraphBuilder(graph).build())
      records = optimize(graph)
      opt_df2 = records.get_optimization_result(df2.data)
      assert _norm_vars(opt_df2.op.expr) == "(`b`) < (@scalar)"
  
      r_df2 = fetch(execute(df2))
      pd.testing.assert_frame_equal(
          r_df2, raw[raw.b < pd.Timestamp("2022-3-20")]
      )
  
file_path: mars/mars/optimization/logical/tileable/tests/test_arithmetic_query.py
imports: import re
  import numpy
  import pandas
  from .....None import dataframe
  from .....None import execute, fetch
  from .....core import enter_mode, TileableGraph, TileableGraphBuilder
  from .....dataframe.base.eval import DataFrameEval
  from ..None import optimize
label_desc: Use image node_id 3 for calling a global function with example usage: test_bool_eval_to_query(setup) without return types