Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Fix ruff rule E714: Test for object identity should be is not #49813

Merged
merged 5 commits into from
Jan 14, 2025
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ ignore = [
"C419",
# Below are auto-fixable rules
"I001",
"E714",
]

[tool.ruff.lint.flake8-quotes]
Expand Down
4 changes: 2 additions & 2 deletions python/ray/tests/test_component_failures_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def g(*xs):
time.sleep(1)
process.kill()
process.wait()
assert not process.poll() is None
assert process.poll() is not None

# Make sure that we can still get the objects after the
# executing tasks died.
Expand Down Expand Up @@ -95,7 +95,7 @@ def check_components_alive(cluster, component_type, check_component_alive):
+ str(process.pid)
+ "to terminate"
)
assert not process.poll() is None
assert process.poll() is not None


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions python/ray/tests/test_multinode_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def g(*xs):
time.sleep(1)
process.kill()
process.wait()
assert not process.poll() is None
assert process.poll() is not None

# Make sure that we can still get the objects after the
# executing tasks died.
Expand Down Expand Up @@ -154,7 +154,7 @@ def check_components_alive(cluster, component_type, check_component_alive):
+ str(process.pid)
+ "to terminate"
)
assert not process.poll() is None
assert process.poll() is not None


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion python/ray/tests/test_multinode_failures_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def g(x):
time.sleep(1)
process.kill()
process.wait()
assert not process.poll() is None
assert process.poll() is not None

# Make sure that we can still get the objects after the
# executing tasks died.
Expand Down
2 changes: 1 addition & 1 deletion release/ray_release/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def validate_aws_config(aws_config: Dict[str, Any]) -> Optional[str]:
if not ebs:
continue

if not ebs.get("DeleteOnTermination", False) is True:
if ebs.get("DeleteOnTermination", False) is not True:
return "Ebs volume does not have `DeleteOnTermination: true` set"
return None

Expand Down
2 changes: 1 addition & 1 deletion rllib/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def deprecation_warning(
)

if error:
if not type(error) is bool and issubclass(error, Exception):
if not isinstance(error, bool) and issubclass(error, Exception):
# error is an Exception
raise error(msg)
else:
Expand Down
Loading