revert: Partial revert of 17236 (#17383)

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2021-11-10 20:32:35 -08:00
committed by GitHub
parent a1961cfc6f
commit 675ffaf8df
3 changed files with 17 additions and 14 deletions

View File

@@ -1326,6 +1326,11 @@ def get_metric_names(metrics: Sequence[Metric]) -> List[str]:
return [metric for metric in map(get_metric_name, metrics) if metric]
def get_first_metric_name(metrics: Sequence[Metric]) -> Optional[str]:
metric_labels = get_metric_names(metrics)
return metric_labels[0] if metric_labels else None
def ensure_path_exists(path: str) -> None:
try:
os.makedirs(path)