Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ disable=
useless-object-inheritance, # TODO: Remove unnecessary imports
cyclic-import, # TODO: Resolve cyclic imports
no-self-use, # TODO: Convert methods to functions where appropriate
consider-using-in, # TODO: Consider merging comparisons with "in"
too-many-public-methods, # TODO: Resolve
consider-using-ternary, # TODO: Consider ternary expressions
chained-comparison, # TODO: Simplify chained comparison between operands
Expand Down
6 changes: 3 additions & 3 deletions src/sagemaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ def _check_job_status(self, job, desc, status_key_name):
# If the status is capital case, then convert it to Camel case
status = _STATUS_CODE_TABLE.get(status, status)

if status != "Completed" and status != "Stopped":
if status not in ("Completed", "Stopped"):
reason = desc.get("FailureReason", "(No reason provided)")
job_type = status_key_name.replace("JobStatus", " job")
raise ValueError("Error for {} {}: {} Reason: {}".format(job_type, job, status, reason))
Expand Down Expand Up @@ -1292,7 +1292,7 @@ def logs_for_job( # noqa: C901 - suppress complexity warning for this method
client = self.boto_session.client("logs", config=config)
log_group = "/aws/sagemaker/TrainingJobs"

job_already_completed = status == "Completed" or status == "Failed" or status == "Stopped"
job_already_completed = status in ("Completed", "Failed", "Stopped")

state = LogState.TAILING if wait and not job_already_completed else LogState.COMPLETE
dot = False
Expand Down Expand Up @@ -1385,7 +1385,7 @@ def logs_for_job( # noqa: C901 - suppress complexity warning for this method

status = description["TrainingJobStatus"]

if status == "Completed" or status == "Failed" or status == "Stopped":
if status in ("Completed", "Failed", "Stopped"):
print()
state = LogState.JOB_COMPLETE

Expand Down