class_docstr: Writes inference results to a TextIO as human-readable text.
class_docstr_tok: ["Writes","inference","results","to","a","TextIO","as","human-readable","text","."]
docstr: Write the results to the configured TextIO as human-readable text.
docstr_tok: ["Write","the","results","to","the","configured","TextIO","as","human-readable","text","."]
code: def render(self, results: List[InferenceResult]) -> None:
      """Write the results to the configured TextIO as human-readable text."""
      list_delim = "\n    - "
  
      results_by_table: Dict[
          SqlTable, List[InferenceResult]
      ] = defaultdict(list)
      for result in results:
          results_by_table[result.column.table].append(result)
  
      for table, results in results_by_table.items():
          lines: List[str] = [table.sql + "\n"]
          for result in results:
              reasons_str = " -- "
              if len(result.reasons) > 0:
                  reasons_str = list_delim + list_delim.join(
                      result.reasons
                  )
  
              problems_str = " -- "
              if len(result.problems) > 0:
                  problems_str = list_delim + list_delim.join(
                      result.problems
                  )
  
              lines += [
                  f"  {result.column.column_name}\n",
                  f"    type: {result.type_node.name}\n",
                  "    reasons: ",
                  reasons_str,
                  "\n    problems: ",
                  problems_str,
                  "\n\n",
              ]
          self.stream.writelines(lines)
  
      if self.close_after_render:
          self.stream.close()
  
file_path: metricflow/metricflow/inference/renderer/stream.py
imports: from __future__ import annotations
  import sys
  from collections import defaultdict
  from typing import Dict, List, TextIO
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.inference.models import InferenceResult
  from metricflow.inference.renderer.base import InferenceRenderer
label_desc: Use image node_id 4 for calling the StreamInferenceRenderer obj's underlying member method code with example usage: obj.render(results) without return types