code: def test_should_benefit_from_pushdown(
      self, merge_mock, evaluate_mock
  ):
      # added to mock away the
      evaluate_mock.return_value = Batch(
          pd.DataFrame(
              {
                  "obj.labels": ["car"],
                  "obj.bboxes": [np.array([1, 2, 3, 4])],
                  "obj.scores": [0.8],
              }
          )
      )
      query = """SELECT id, obj.labels
                    FROM MyVideo JOIN LATERAL
                      FastRCNNObjectDetector(data) AS obj(labels, bboxes, scores)
                    WHERE id < 2;"""
  
      time_with_rule = Timer()
      result_with_rule = None
      with time_with_rule:
          result_with_rule = execute_query_fetch_all(self.evadb, query)
  
      evaluate_count_with_rule = evaluate_mock.call_count
  
      time_without_rule = Timer()
      result_without_pushdown_rules = None
  
      with time_without_rule:
          rules_manager = RulesManager()
          with disable_rules(
              rules_manager,
              [
                  PushDownFilterThroughApplyAndMerge(),
                  PushDownFilterThroughJoin(),
              ],
          ):
              custom_plan_generator = PlanGenerator(
                  self.evadb, rules_manager
              )
              result_without_pushdown_rules = execute_query_fetch_all(
                  self.evadb,
                  query,
                  plan_generator=custom_plan_generator,
              )
  
      self.assertEqual(result_without_pushdown_rules, result_with_rule)
  
      evaluate_count_without_rule = (
          evaluate_mock.call_count - evaluate_count_with_rule
      )
  
      # without rule it should be slow as we end up running the function
      # on all the frames
      self.assertGreater(
          evaluate_count_without_rule, 3 * evaluate_count_with_rule
      )
  
imports: import unittest
  from test.markers import gpu_skip_marker
  from test.util import get_evadb_for_testing, get_physical_query_plan, load_functions_for_testing, shutdown_ray
  import numpy
  import pandas
  import pytest
  from mock import MagicMock, patch
  from evadb.configuration.constants import EvaDB_ROOT_DIR
  from evadb.expression.comparison_expression import ComparisonExpression
  from evadb.models.storage.batch import Batch
  from evadb.optimizer.plan_generator import PlanGenerator
  from evadb.optimizer.rules.rules import PushDownFilterThroughApplyAndMerge, PushDownFilterThroughJoin, ReorderPredicates
  from evadb.optimizer.rules.rules_manager import RulesManager, disable_rules
  from evadb.plan_nodes.predicate_plan import PredicatePlan
  from evadb.server.command_handler import execute_query_fetch_all
  from evadb.utils.stats import Timer
label_desc: Use image node_id 3 for calling the OptimizerRulesTest obj's underlying member method code with example usage: obj.test_should_benefit_from_pushdown(merge_mock, evaluate_mock) without return types