class_docstr: State API Client issues REST GET requests to the server for resource states.
class_docstr_tok: ["State","API","Client","issues","REST","GET","requests","to","the","server","for","resource","states","."]
docstr: Print the API warnings.
  
  Args:
      resource: Resource names, i.e. 'jobs', 'actors', 'nodes',
          see `StateResource` for details.
      api_response: The dictionarified `ListApiResponse` or `SummaryApiResponse`.
      warn_data_source_not_available: Warn when some data sources
          are not available.
      warn_data_truncation: Warn when results were truncated at
          the data source.
      warn_limit: Warn when results were limited.
      warn_server_side_warnings: Warn when the server side generates warnings
          (E.g., when callsites not enabled for listing objects)
docstr_tok: ["Print","the","API","warnings",".","Args",":","resource",":","Resource","names",",","i.e",".","'jobs","'",",","'actors","'",",","'nodes","'",",","see","`","StateResource","`","for","details",".","api_response",":","The","dictionarified","`","ListApiResponse","`","or","`","SummaryApiResponse","`",".","warn_data_source_not_available",":","Warn","when","some","data","sources","are","not","available",".","warn_data_truncation",":","Warn","when","results","were","truncated","at","the","data","source",".","warn_limit",":","Warn","when","results","were","limited",".","warn_server_side_warnings",":","Warn","when","the","server","side","generates","warnings","(","E.g.",",","when","callsites","not","enabled","for","listing","objects",")"]
code: def _print_api_warning(
      self,
      resource: StateResource,
      api_response: dict,
      warn_data_source_not_available: bool = True,
      warn_data_truncation: bool = True,
      warn_limit: bool = True,
      warn_server_side_warnings: bool = True,
  ):
      """Print the API warnings.
  
      Args:
          resource: Resource names, i.e. 'jobs', 'actors', 'nodes',
              see `StateResource` for details.
          api_response: The dictionarified `ListApiResponse` or `SummaryApiResponse`.
          warn_data_source_not_available: Warn when some data sources
              are not available.
          warn_data_truncation: Warn when results were truncated at
              the data source.
          warn_limit: Warn when results were limited.
          warn_server_side_warnings: Warn when the server side generates warnings
              (E.g., when callsites not enabled for listing objects)
      """
      # Print warnings if anything was given.
      if warn_data_source_not_available:
          warning_msgs = api_response.get(
              "partial_failure_warning", None
          )
          if warning_msgs:
              warnings.warn(warning_msgs)
  
      if warn_data_truncation:
          # Print warnings if data is truncated at the data source.
          num_after_truncation = api_response["num_after_truncation"]
          total = api_response["total"]
          if total > num_after_truncation:
              # NOTE(rickyyx): For now, there's not much users
              # could do (neither can we), with hard truncation.
              # Unless we allow users to set a higher
              # `RAY_MAX_LIMIT_FROM_DATA_SOURCE`, the data will
              # always be truncated at the data source.
              warnings.warn(
                  (
                      "The returned data may contain incomplete result. "
                      f"{num_after_truncation} ({total} total from the cluster) "
                      f"{resource.value} are retrieved from the data source. "
                      f"{total - num_after_truncation} entries have been truncated. "
                      f"Max of {num_after_truncation} entries are retrieved "
                      "from data source to prevent over-sized payloads."
                  ),
              )
  
      if warn_limit:
          # Print warnings if return data is limited at the API server due to
          # limit enforced at the server side
          num_filtered = api_response["num_filtered"]
          data = api_response["result"]
          if num_filtered > len(data):
              warnings.warn(
                  (
                      f"Limit last {len(data)} entries "
                      f"(Total {num_filtered}). Use `--filter` to reduce "
                      "the amount of data to return or "
                      "setting a higher limit with `--limit` to see all data. "
                  ),
              )
  
      if warn_server_side_warnings:
          # Print the additional warnings.
          warnings_to_print = api_response.get("warnings", [])
          if warnings_to_print:
              for warning_to_print in warnings_to_print:
                  warnings.warn(warning_to_print)
  
imports: import logging
  import threading
  import urllib
  import warnings
  from contextlib import contextmanager
  from dataclasses import fields
  from typing import Any, Dict, Generator, List, Optional, Tuple, Union
  import requests
  from ray.dashboard.modules.dashboard_sdk import SubmissionClient
  from ray.dashboard.utils import get_address_for_submission_client, ray_address_to_api_server_url
  from ray.util.annotations import DeveloperAPI
  from ray.util.state.common import DEFAULT_LIMIT, DEFAULT_RPC_TIMEOUT, ActorState, ClusterEventState, GetApiOptions, GetLogOptions, JobState, ListApiOptions, NodeState, ObjectState, PlacementGroupState, PredicateType, RuntimeEnvState, StateResource, SummaryApiOptions, SummaryResource, SupportedFilterType, TaskState, WorkerState, dict_to_state
  from ray.util.state.exception import RayStateApiException, ServerUnavailable
label_desc: Use image node_id 5 for calling the StateApiClient obj's underlying member method code with example usage: obj._print_api_warning(resource, api_response, warn_data_source_not_available, warn_data_truncation, warn_limit, warn_server_side_warnings) without return types