From d086c598757c11684e0503b781234cdfae486acf Mon Sep 17 00:00:00 2001 From: Gautam Kumar Date: Thu, 28 May 2020 22:05:14 -0700 Subject: [PATCH] fixing case when status is None (#3865) * fixing case when status is None * Fixing status update --- .../tests/integration_tests/utils/kfp_client_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py b/components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py index 2949f7b3c0a0..a3ef367e2fbd 100644 --- a/components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py +++ b/components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py @@ -26,7 +26,9 @@ def compile_and_run_pipeline( def wait_for_job_completion(client, run_id, timeout, status_to_check): response = client.wait_for_run_completion(run_id, timeout) - status = response.run.status.lower() == status_to_check + status = None + if response.run.status: + status = response.run.status.lower() == status_to_check return status @@ -36,8 +38,9 @@ def wait_for_job_status(client, run_id, timeout, status_to_check="succeeded"): else: time.sleep(timeout) response = client.get_run(run_id) - status = response.run.status.lower() == status_to_check - + status = None + if response.run.status: + status = response.run.status.lower() == status_to_check return status