From 07dfc8433ce4d15a5c95f638d700ebd34449534f Mon Sep 17 00:00:00 2001 From: Andrey Velichkevich Date: Wed, 3 Jan 2024 19:25:04 +0000 Subject: [PATCH] Update func description --- sdk/python/kubeflow/training/api/training_client.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/python/kubeflow/training/api/training_client.py b/sdk/python/kubeflow/training/api/training_client.py index 5d341f1aef..d623858e68 100644 --- a/sdk/python/kubeflow/training/api/training_client.py +++ b/sdk/python/kubeflow/training/api/training_client.py @@ -772,9 +772,12 @@ def get_job_logs( replica_index: Optional[int] = None, follow: bool = False, timeout: int = constants.DEFAULT_TIMEOUT, - ) -> Dict[str, str]: - """Print the training logs for the Job. By default it returns logs from - the `master` pod. + ) -> Optional[Dict[str, str]]: + """Get the logs for every Training Job pod. By default it returns logs from + the `master` pod. Logs are returned in this format: { "pod-name": "Log data" }. + + If follow = True, this function prints logs to StdOut and returns None. + Args: name: Name for the Job. @@ -845,7 +848,7 @@ def get_job_logs( while True: for index, log_queue in enumerate(log_queue_pool): if all(finished): - return {} + return if finished[index]: continue # grouping the every 50 log lines of the same pod