class_docstr: Airflow rich console.
class_docstr_tok: ["Airflow","rich","console","."]
docstr: Print provided using format specified by output argument.
docstr_tok: ["Print","provided","using","format","specified","by","output","argument","."]
code: def print_as(
      self,
      data: Sequence[dict | Any],
      output: str,
      mapper: Callable[[Any], dict] | None = None,
  ) -> None:
      """Print provided using format specified by output argument."""
      output_to_renderer: dict[str, Callable[[Any], None]] = {
          "json": self.print_as_json,
          "yaml": self.print_as_yaml,
          "table": self.print_as_table,
          "plain": self.print_as_plain_table,
      }
      renderer = output_to_renderer.get(output)
      if not renderer:
          raise ValueError(
              f"Unknown formatter: {output}. Allowed options: {list(output_to_renderer)}"
          )
  
      if mapper:
          dict_data: Sequence[dict] = [mapper(d) for d in data]
      elif is_data_sequence(data):
          dict_data = data
      else:
          raise ValueError(
              "To tabulate non-dictionary data you need to provide `mapper` function"
          )
      dict_data = [
          {k: self._normalize_data(v, output) for k, v in d.items()}
          for d in dict_data
      ]
      renderer(dict_data)
  
imports: from __future__ import annotations
  import inspect
  import json
  from typing import TYPE_CHECKING, Any, Callable, Sequence
  from rich.box import ASCII_DOUBLE_HEAD
  from rich.console import Console
  from rich.syntax import Syntax
  from rich.table import Table
  from tabulate import tabulate
  from airflow.plugins_manager import PluginsDirectorySource
  from airflow.utils import yaml
  from airflow.utils.platform import is_tty
label_desc: Use image node_id 7 for calling the AirflowConsole obj's underlying member method code with example usage: obj.print_as(data, output, mapper) without return types