@@ -1022,7 +1022,7 @@ def _check_job_status(self, job, desc, status_key_name):
10221022 # If the status is capital case, then convert it to Camel case
10231023 status = _STATUS_CODE_TABLE .get (status , status )
10241024
1025- if status != "Completed" and status != "Stopped" :
1025+ if status not in ( "Completed" , "Stopped" ) :
10261026 reason = desc .get ("FailureReason" , "(No reason provided)" )
10271027 job_type = status_key_name .replace ("JobStatus" , " job" )
10281028 raise ValueError ("Error for {} {}: {} Reason: {}" .format (job_type , job , status , reason ))
@@ -1292,7 +1292,7 @@ def logs_for_job( # noqa: C901 - suppress complexity warning for this method
12921292 client = self .boto_session .client ("logs" , config = config )
12931293 log_group = "/aws/sagemaker/TrainingJobs"
12941294
1295- job_already_completed = status == "Completed" or status == "Failed" or status == "Stopped"
1295+ job_already_completed = status in ( "Completed" , "Failed" , "Stopped" )
12961296
12971297 state = LogState .TAILING if wait and not job_already_completed else LogState .COMPLETE
12981298 dot = False
@@ -1385,7 +1385,7 @@ def logs_for_job( # noqa: C901 - suppress complexity warning for this method
13851385
13861386 status = description ["TrainingJobStatus" ]
13871387
1388- if status == "Completed" or status == "Failed" or status == "Stopped" :
1388+ if status in ( "Completed" , "Failed" , "Stopped" ) :
13891389 print ()
13901390 state = LogState .JOB_COMPLETE
13911391
0 commit comments