code: def test_in_expr_todo():
      import pyarrow.gandiva as gandiva
  
      # TODO: Implement reasonable support for timestamp, time & date.
      # Current exceptions:
      # pyarrow.lib.ArrowException: ExpressionValidationError:
      # Evaluation expression for IN clause returns XXXX values are of typeXXXX
  
      # binary
      arr = pa.array([b"ga", b"an", b"nd", b"di", b"iv", b"va"])
      table = pa.Table.from_arrays([arr], ["a"])
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      cond = builder.make_in_expression(
          node_a, [b"an", b"nd"], pa.binary()
      )
      condition = builder.make_condition(cond)
  
      filter = gandiva.make_filter(table.schema, condition)
      result = filter.evaluate(
          table.to_batches()[0], pa.default_memory_pool()
      )
      assert result.to_array().equals(
          pa.array([1, 2], type=pa.uint32())
      )
  
      # timestamp
      datetime_1 = datetime.datetime.utcfromtimestamp(1542238951.621877)
      datetime_2 = datetime.datetime.utcfromtimestamp(1542238911.621877)
      datetime_3 = datetime.datetime.utcfromtimestamp(1542238051.621877)
  
      arr = pa.array([datetime_1, datetime_2, datetime_3])
      table = pa.Table.from_arrays([arr], ["a"])
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      cond = builder.make_in_expression(
          node_a, [datetime_2], pa.timestamp("ms")
      )
      condition = builder.make_condition(cond)
  
      filter = gandiva.make_filter(table.schema, condition)
      result = filter.evaluate(
          table.to_batches()[0], pa.default_memory_pool()
      )
      assert list(result.to_array()) == [1]
  
      # time
      time_1 = datetime_1.time()
      time_2 = datetime_2.time()
      time_3 = datetime_3.time()
  
      arr = pa.array([time_1, time_2, time_3])
      table = pa.Table.from_arrays([arr], ["a"])
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      cond = builder.make_in_expression(
          node_a, [time_2], pa.time64("ms")
      )
      condition = builder.make_condition(cond)
  
      filter = gandiva.make_filter(table.schema, condition)
      result = filter.evaluate(
          table.to_batches()[0], pa.default_memory_pool()
      )
      assert list(result.to_array()) == [1]
  
      # date
      date_1 = datetime_1.date()
      date_2 = datetime_2.date()
      date_3 = datetime_3.date()
  
      arr = pa.array([date_1, date_2, date_3])
      table = pa.Table.from_arrays([arr], ["a"])
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      cond = builder.make_in_expression(node_a, [date_2], pa.date32())
      condition = builder.make_condition(cond)
  
      filter = gandiva.make_filter(table.schema, condition)
      result = filter.evaluate(
          table.to_batches()[0], pa.default_memory_pool()
      )
      assert list(result.to_array()) == [1]
  
file_path: arrow/python/pyarrow/tests/test_gandiva.py
imports: import datetime
  import pytest
  import pyarrow
label_desc: Use image node_id 5 for calling a global function with example usage: test_in_expr_todo() without return types