Skip to content

Commit ccd71e6

Browse files
wweicJonathan Esterhazy
authored andcommitted
translate neo status codes
1 parent 5b748a2 commit ccd71e6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/sagemaker/session.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
LOGGER.setLevel(logging.INFO)
3737

3838

39+
_STATUS_CODE_TABLE = {
40+
'COMPLETED': 'Completed',
41+
'INPROGRESS': 'InProgress',
42+
'FAILED': 'Failed',
43+
'STOPPED': 'Stopped',
44+
'STOPPING': 'Stopping',
45+
'STARTING': 'Starting'
46+
}
47+
48+
3949
class LogState(object):
4050
STARTING = 1
4151
WAIT_IN_PROGRESS = 2
@@ -804,6 +814,8 @@ def _check_job_status(self, job, desc, status_key_name):
804814
ValueError: If the training job fails.
805815
"""
806816
status = desc[status_key_name]
817+
# If the status is capital case, then convert it to Camel case
818+
status = _STATUS_CODE_TABLE.get(status, status)
807819

808820
if status != 'Completed' and status != 'Stopped':
809821
reason = desc.get('FailureReason', '(No reason provided)')
@@ -1335,6 +1347,7 @@ def _compilation_job_status(sagemaker_client, job_name):
13351347
desc = sagemaker_client.describe_compilation_job(CompilationJobName=job_name)
13361348
status = desc['CompilationJobStatus']
13371349

1350+
status = _STATUS_CODE_TABLE.get(status, status)
13381351
print(compile_status_codes.get(status, '?'), end='')
13391352
sys.stdout.flush()
13401353

0 commit comments

Comments
 (0)