code: def _convert_filters_type(
      filter: List[Tuple[str, PredicateType, SupportedFilterType]],
      schema: StateSchema,
  ) -> List[Tuple[str, SupportedFilterType]]:
      """Convert the given filter's type to SupportedFilterType.
  
      This method is necessary because click can only accept a single type
      for its tuple (which is string in this case).
  
      Args:
          filter: A list of filter which is a tuple of (key, val).
          schema: The state schema. It is used to infer the type of the column for filter.
  
      Returns:
          A new list of filters with correct types that match the schema.
      """
      new_filter = []
      if dataclasses.is_dataclass(schema):
          schema = {field.name: field.type for field in fields(schema)}
      else:
          schema = schema.schema_dict()
  
      for col, predicate, val in filter:
          if col in schema:
              column_type = schema[col]
              try:
                  isinstance(val, column_type)
              except TypeError:
                  # Calling `isinstance` to the Literal type raises a TypeError.
                  # Ignore this case.
                  pass
              else:
                  if isinstance(val, column_type):
                      # Do nothing.
                      pass
                  elif column_type is int or column_type == "integer":
                      try:
                          val = convert_string_to_type(val, int)
                      except ValueError:
                          raise ValueError(
                              f"Invalid filter `--filter {col} {val}` for a int type "
                              "column. Please provide an integer filter "
                              f"`--filter {col} [int]`"
                          )
                  elif column_type is float or column_type == "number":
                      try:
                          val = convert_string_to_type(
                              val,
                              float,
                          )
                      except ValueError:
                          raise ValueError(
                              f"Invalid filter `--filter {col} {val}` for a float "
                              "type column. Please provide an integer filter "
                              f"`--filter {col} [float]`"
                          )
                  elif column_type is bool or column_type == "boolean":
                      try:
                          val = convert_string_to_type(val, bool)
                      except ValueError:
                          raise ValueError(
                              f"Invalid filter `--filter {col} {val}` for a boolean "
                              "type column. Please provide "
                              f"`--filter {col} [True|true|1]` for True or "
                              f"`--filter {col} [False|false|0]` for False."
                          )
          new_filter.append((col, predicate, val))
      return new_filter
  
file_path: ray/python/ray/dashboard/state_aggregator.py
imports: import asyncio
  import logging
  from dataclasses import fields
  import dataclasses
  from itertools import islice
  from typing import List, Tuple, Optional
  from datetime import datetime
  from ray._private.ray_constants import env_integer
  from ray._private.profiling import chrome_tracing_dump
  import ray.dashboard.memory_utils
  from ray.util.state.common import protobuf_message_to_dict, ActorState, JobState, ListApiOptions, ListApiResponse, NodeState, ObjectState, PlacementGroupState, RuntimeEnvState, SummaryApiResponse, RAY_MAX_LIMIT_FROM_API_SERVER, SummaryApiOptions, TaskSummaries, StateSchema, SupportedFilterType, TaskState, WorkerState, StateSummary, ActorSummaries, ObjectSummaries, ClusterEventState, filter_fields, PredicateType, protobuf_to_task_state_dict
  from ray.util.state.state_manager import DataSourceUnavailable, StateDataSourceClient
  from ray.runtime_env import RuntimeEnv
  from ray.util.state.util import convert_string_to_type
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_filters_type(filter, schema) and returns: new_filter