code: def test_rules_promises_order(self):
      # Promise of all rewrite should be greater than implementation
      rewrite_promises = [
          Promise.LOGICAL_INNER_JOIN_COMMUTATIVITY,
          Promise.EMBED_FILTER_INTO_GET,
          Promise.EMBED_SAMPLE_INTO_GET,
          Promise.XFORM_LATERAL_JOIN_TO_LINEAR_FLOW,
          Promise.PUSHDOWN_FILTER_THROUGH_JOIN,
          Promise.PUSHDOWN_FILTER_THROUGH_APPLY_AND_MERGE,
          Promise.COMBINE_SIMILARITY_ORDERBY_AND_LIMIT_TO_VECTOR_INDEX_SCAN,
          Promise.REORDER_PREDICATES,
          Promise.XFORM_EXTRACT_OBJECT_TO_LINEAR_FLOW,
      ]
  
      for promise in rewrite_promises:
          self.assertTrue(promise > Promise.IMPLEMENTATION_DELIMITER)
  
      # Promise of implementation rules should be lesser than rewrite rules
      implementation_promises = [
          Promise.LOGICAL_EXCHANGE_TO_PHYSICAL,
          Promise.LOGICAL_UNION_TO_PHYSICAL,
          Promise.LOGICAL_GROUPBY_TO_PHYSICAL,
          Promise.LOGICAL_ORDERBY_TO_PHYSICAL,
          Promise.LOGICAL_LIMIT_TO_PHYSICAL,
          Promise.LOGICAL_INSERT_TO_PHYSICAL,
          Promise.LOGICAL_DELETE_TO_PHYSICAL,
          Promise.LOGICAL_RENAME_TO_PHYSICAL,
          Promise.LOGICAL_DROP_OBJECT_TO_PHYSICAL,
          Promise.LOGICAL_LOAD_TO_PHYSICAL,
          Promise.LOGICAL_CREATE_TO_PHYSICAL,
          Promise.LOGICAL_CREATE_FROM_SELECT_TO_PHYSICAL,
          Promise.LOGICAL_CREATE_FUNCTION_TO_PHYSICAL,
          Promise.LOGICAL_CREATE_FUNCTION_FROM_SELECT_TO_PHYSICAL,
          Promise.LOGICAL_SAMPLE_TO_UNIFORMSAMPLE,
          Promise.LOGICAL_GET_TO_SEQSCAN,
          Promise.LOGICAL_DERIVED_GET_TO_PHYSICAL,
          Promise.LOGICAL_LATERAL_JOIN_TO_PHYSICAL,
          Promise.LOGICAL_JOIN_TO_PHYSICAL_HASH_JOIN,
          Promise.LOGICAL_JOIN_TO_PHYSICAL_NESTED_LOOP_JOIN,
          Promise.LOGICAL_FUNCTION_SCAN_TO_PHYSICAL,
          Promise.LOGICAL_FILTER_TO_PHYSICAL,
          Promise.LOGICAL_PROJECT_TO_PHYSICAL,
          Promise.LOGICAL_PROJECT_NO_TABLE_TO_PHYSICAL,
          Promise.LOGICAL_SHOW_TO_PHYSICAL,
          Promise.LOGICAL_EXPLAIN_TO_PHYSICAL,
          Promise.LOGICAL_CREATE_INDEX_TO_VECTOR_INDEX,
          Promise.LOGICAL_APPLY_AND_MERGE_TO_PHYSICAL,
          Promise.LOGICAL_VECTOR_INDEX_SCAN_TO_PHYSICAL,
      ]
  
      for promise in implementation_promises:
          self.assertTrue(promise < Promise.IMPLEMENTATION_DELIMITER)
  
      promise_count = len(Promise)
      rewrite_count = len(set(rewrite_promises))
      implementation_count = len(set(implementation_promises))
  
      # rewrite_count + implementation_count + 1 (for IMPLEMENTATION_DELIMITER)
      self.assertEqual(
          rewrite_count + implementation_count + 4, promise_count
      )
  
imports: import unittest
  from test.util import create_sample_video, get_evadb_for_testing
  import pytest
  from mock import MagicMock, patch
  from evadb.catalog.catalog_type import TableType
  from evadb.catalog.models.table_catalog import TableCatalogEntry
  from evadb.optimizer.operators import LogicalFilter, LogicalGet, LogicalJoin, LogicalSample
  from evadb.optimizer.rules.rules import CacheFunctionExpressionInApply, CacheFunctionExpressionInFilter, CacheFunctionExpressionInProject, CombineSimilarityOrderByAndLimitToVectorIndexScan, EmbedFilterIntoGet, EmbedSampleIntoGet, LogicalApplyAndMergeToPhysical, LogicalApplyAndMergeToRayPhysical, LogicalCreateFromSelectToPhysical, LogicalCreateFunctionFromSelectToPhysical, LogicalCreateFunctionToPhysical, LogicalCreateIndexToVectorIndex, LogicalCreateToPhysical, LogicalDeleteToPhysical, LogicalDerivedGetToPhysical, LogicalDropObjectToPhysical, LogicalExchangeToPhysical, LogicalExplainToPhysical, LogicalFilterToPhysical, LogicalFunctionScanToPhysical, LogicalGetToSeqScan, LogicalGroupByToPhysical, LogicalInnerJoinCommutativity, LogicalInsertToPhysical, LogicalJoinToPhysicalHashJoin, LogicalJoinToPhysicalNestedLoopJoin, LogicalLateralJoinToPhysical, LogicalLimitToPhysical, LogicalLoadToPhysical, LogicalOrderByToPhysical, LogicalProjectNoTableToPhysical, LogicalProjectToPhysical, LogicalProjectToRayPhysical, LogicalRenameToPhysical, LogicalShowToPhysical, LogicalUnionToPhysical, LogicalVectorIndexScanToPhysical, Promise, PushDownFilterThroughApplyAndMerge, PushDownFilterThroughJoin, ReorderPredicates, Rule, RuleType, XformExtractObjectToLinearFlow, XformLateralJoinToLinearFlow
  from evadb.optimizer.rules.rules_manager import RulesManager, disable_rules
  from evadb.parser.types import JoinType
  from evadb.server.command_handler import execute_query_fetch_all
  from evadb.utils.generic_utils import is_ray_enabled_and_installed
label_desc: Use image node_id 3 for calling the RulesTest obj's underlying member method code with example usage: obj.test_rules_promises_order() without return types