Esempio n. 1
0
def metric_line_title(metric_definition: _Tuple,
                      translated_metrics: Dict) -> str:
    if len(metric_definition) >= 3:
        return metric_definition[2]

    metric_name = next(metrics_used_in_expression(metric_definition[0]))
    return translated_metrics[metric_name]["title"]
Esempio n. 2
0
def metric_line_title(metric_definition: MetricDefinition,
                      translated_metrics: TranslatedMetrics) -> str:
    if len(metric_definition) >= 3:
        # mypy does not understand the variable length (Tuple index out of range)
        metric_title = metric_definition[2]  # type: ignore[misc]
        return str(metric_title)

    metric_name = next(metrics_used_in_expression(metric_definition[0]))
    return translated_metrics[metric_name]["title"]