From ec4888497ccf210d5426bcd40b2aa6eecab36ed3 Mon Sep 17 00:00:00 2001 From: Sakari Ikonen Date: Fri, 16 Aug 2024 14:36:02 +0300 Subject: [PATCH] correctly return empty list for log paths when missing ds_root or ds_type --- services/ui_backend_service/data/cache/get_log_file_action.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ui_backend_service/data/cache/get_log_file_action.py b/services/ui_backend_service/data/cache/get_log_file_action.py index 0fe9daf6..3ea036d9 100644 --- a/services/ui_backend_service/data/cache/get_log_file_action.py +++ b/services/ui_backend_service/data/cache/get_log_file_action.py @@ -206,7 +206,7 @@ def log_size_exceeded_blurb(task: Task, logtype: str, max_size: int): return blurb -def fetch_logs(task: Task, to_path: str, logtype: str, force_reload: bool = False): +def fetch_logs(task: Task, to_path: str, logtype: str, force_reload: bool = False) -> List[str]: # TODO: This could theoretically be a part of the Metaflow client instead. paths = [] stream = 'stderr' if logtype == STDERR else 'stdout' @@ -243,7 +243,7 @@ def fetch_logs(task: Task, to_path: str, logtype: str, force_reload: bool = Fals ds_type = meta_dict.get("ds-type") ds_root = meta_dict.get("ds-root") if ds_type is None or ds_root is None: - return + return [] attempt = task.current_attempt