Skip to content

Commit aab1675

Browse files
authored
change: enable consider-using-in Pylint check (#938)
* change: enable consider-using-in Pylint check
1 parent 1badf76 commit aab1675

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.pylintrc

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ disable=
8989
useless-object-inheritance, # TODO: Remove unnecessary imports
9090
cyclic-import, # TODO: Resolve cyclic imports
9191
no-self-use, # TODO: Convert methods to functions where appropriate
92-
consider-using-in, # TODO: Consider merging comparisons with "in"
9392
too-many-public-methods, # TODO: Resolve
9493
consider-using-ternary, # TODO: Consider ternary expressions
9594
chained-comparison, # TODO: Simplify chained comparison between operands

src/sagemaker/session.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)