class_docstr: Base class for representing metrics.
  
  The `fetch_trial_data` method is the essential method to override when
  subclassing, which specifies how to retrieve a Metric, for a given trial.
  
  A Metric must return a Data object, which requires (at minimum) the following:
      https://ax.dev/api/_modules/ax/core/data.html#Data.required_columns
  
  Attributes:
      lower_is_better: Flag for metrics which should be minimized.
      properties: Properties specific to a particular metric.
class_docstr_tok: ["Base","class","for","representing","metrics",".","The","`","fetch_trial_data","`","method","is","the","essential","method","to","override","when","subclassing",",","which","specifies","how","to","retrieve","a","Metric",",","for","a","given","trial",".","A","Metric","must","return","a","Data","object",",","which","requires","(","at","minimum",")","the","following",":","https",":","\/\/ax.dev\/api\/_modules\/ax\/core\/data.html","#","Data.required_columns","Attributes",":","lower_is_better",":","Flag","for","metrics","which","should","be","minimized",".","properties",":","Properties","specific","to","a","particular","metric","."]
code: def _unwrap_trial_data_multi(
      cls,
      results: Mapping[str, MetricFetchResult],
      # TODO[mpolson64] Add critical_metric_names to other unwrap methods
      critical_metric_names: Optional[List[str]] = None,
  ) -> Data:
      # NOTE: This can be lossy (ex. a MapData could get implicitly cast to a Data and
      # lose rows)if some MetricFetchResults contain Data not of type
      # `cls.data_constructor`
  
      oks: List[Ok[Data, MetricFetchE]] = [
          result
          for result in results.values()
          if isinstance(result, Ok)
      ]
      if len(oks) < len(results):
          # If no critical_metric_names supplied all metrics to be treated as
          # critical
          critical_metric_names = critical_metric_names or list(
              results.keys()
          )
  
          # Noncritical Errs should be brought to the user's attention via warnings
          # but not raise an Exception
          noncritical_errs: List[Err[Data, MetricFetchE]] = [
              result
              for metric_name, result in results.items()
              if isinstance(result, Err)
              and metric_name in critical_metric_names
          ]
  
          for err in noncritical_errs:
              logger.warning(
                  f"Err encountered while unwrapping MetricFetchResults: {err.err}. "
                  "Metric is not marked critical, ignoring for now."
              )
  
          critical_errs: List[Err[Data, MetricFetchE]] = [
              result
              for metric_name, result in results.items()
              if isinstance(result, Err)
              and metric_name in critical_metric_names
          ]
  
          if len(critical_errs) > 0:
              # TODO[mpolson64] Raise all errors in a group via PEP 654
              exceptions = [
                  err.err.exception
                  if err.err.exception is not None
                  else Exception(err.err.message)
                  for err in critical_errs
              ]
              raise UnwrapError(critical_errs) from (
                  exceptions[0]
                  if len(exceptions) == 1
                  else Exception(exceptions)
              )
  
      data = [ok.ok for ok in oks]
  
      return (
          cls.data_constructor.from_multiple_data(data=data)
          if len(data) > 0
          else cls.data_constructor()
      )
  
imports: from __future__ import annotations
  import traceback
  import warnings
  from dataclasses import dataclass
  from functools import reduce
  from logging import Logger
  from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Type, TYPE_CHECKING
  from ax.core.data import Data
  from ax.utils.common.base import SortableBase
  from ax.utils.common.logger import get_logger
  from ax.utils.common.result import Err, Ok, Result, UnwrapError
  from ax.utils.common.serialization import SerializationMixin
label_desc: Use image node_id 17 for calling the Metric obj's underlying member method code with example usage: obj._unwrap_trial_data_multi(cls, results, critical_metric_names) and returns: unknown