class_docstr: A class to query states from data source, caches, and post-processes
  the entries.
class_docstr_tok: ["A","class","to","query","states","from","data","source",",","caches",",","and","post-processes","the","entries","."]
docstr: Return the filtered data given filters.
  
  Args:
      data: A list of state data.
      filters: A list of KV tuple to filter data (key, val). The data is filtered
          if data[key] != val.
      state_dataclass: The state schema.
  
  Returns:
      A list of filtered state data in dictionary. Each state data's
      unnecessary columns are filtered by the given state_dataclass schema.
docstr_tok: ["Return","the","filtered","data","given","filters",".","Args",":","data",":","A","list","of","state","data",".","filters",":","A","list","of","KV","tuple","to","filter","data","(","key",",","val",")",".","The","data","is","filtered","if","data","[","key","]","!","=","val",".","state_dataclass",":","The","state","schema",".","Returns",":","A","list","of","filtered","state","data","in","dictionary",".","Each","state","data's","unnecessary","columns","are","filtered","by","the","given","state_dataclass","schema","."]
code: def _filter(
      self,
      data: List[dict],
      filters: List[Tuple[str, SupportedFilterType]],
      state_dataclass: StateSchema,
      detail: bool,
  ) -> List[dict]:
      """Return the filtered data given filters.
  
      Args:
          data: A list of state data.
          filters: A list of KV tuple to filter data (key, val). The data is filtered
              if data[key] != val.
          state_dataclass: The state schema.
  
      Returns:
          A list of filtered state data in dictionary. Each state data's
          unnecessary columns are filtered by the given state_dataclass schema.
      """
      filters = _convert_filters_type(filters, state_dataclass)
      result = []
      for datum in data:
          match = True
          for filter_column, filter_predicate, filter_value in filters:
              filterable_columns = state_dataclass.filterable_columns()
              filter_column = filter_column.lower()
              if filter_column not in filterable_columns:
                  raise ValueError(
                      f"The given filter column {filter_column} is not supported. "
                      f"Supported filter columns: {filterable_columns}"
                  )
  
              if filter_column not in datum:
                  match = False
              elif filter_predicate == "=":
                  if isinstance(filter_value, str) and isinstance(
                      datum[filter_column], str
                  ):
                      # Case insensitive match for string filter values.
                      match = (
                          datum[filter_column].lower()
                          == filter_value.lower()
                      )
                  elif isinstance(filter_value, str) and isinstance(
                      datum[filter_column], bool
                  ):
                      match = datum[
                          filter_column
                      ] == convert_string_to_type(filter_value, bool)
                  elif isinstance(filter_value, str) and isinstance(
                      datum[filter_column], int
                  ):
                      match = datum[
                          filter_column
                      ] == convert_string_to_type(filter_value, int)
                  else:
                      match = datum[filter_column] == filter_value
              elif filter_predicate == "!=":
                  if isinstance(filter_value, str) and isinstance(
                      datum[filter_column], str
                  ):
                      match = (
                          datum[filter_column].lower()
                          != filter_value.lower()
                      )
                  else:
                      match = datum[filter_column] != filter_value
              else:
                  raise ValueError(
                      f"Unsupported filter predicate {filter_predicate} is given. "
                      "Available predicates: =, !=."
                  )
  
              if not match:
                  break
  
          if match:
              result.append(
                  filter_fields(datum, state_dataclass, detail)
              )
      return result
  
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 3 for calling the StateAPIManager obj's underlying member method code with example usage: obj._filter(data, filters, state_dataclass, detail) and returns: result