Skip to content

Commit

Permalink
Merge pull request #292 from tisnik/enable-w0622
Browse files Browse the repository at this point in the history
Enable Pylinter rule W0622 on CI
  • Loading branch information
tisnik authored Jan 20, 2025
2 parents 6c058a5 + b8b9b99 commit 1a6e1a1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions ols/src/cache/redis_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
from redis.backoff import ExponentialBackoff
from redis.exceptions import (
BusyLoadingError,
ConnectionError, # noqa: A004
RedisError,
)
from redis.exceptions import (
ConnectionError as RedisConnectionError,
)
from redis.retry import Retry

from ols.app.models.config import RedisConfig
Expand Down Expand Up @@ -52,7 +54,7 @@ def initialize_redis(self, config: RedisConfig) -> None:

retry_on_error: Optional[list[type[RedisError]]] = None
if config.retry_on_error:
retry_on_error = [BusyLoadingError, ConnectionError]
retry_on_error = [BusyLoadingError, RedisConnectionError]

# initialize Redis client
# pylint: disable=W0201
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ packages = ["ols"]

[tool.pylint."MESSAGES CONTROL"]
good-names = ["e"]
disable = ["C0103", "C0301", "C0302", "E0602", "E0611", "E1101", "R0902", "R0903", "R0913", "R0914", "W0102", "W0212", "W0511", "W0613", "W0621", "W0622", "W0707", "W0718", "W0719", "R0801", "R0917"]
disable = ["C0103", "C0301", "C0302", "E0602", "E0611", "E1101", "R0902", "R0903", "R0913", "R0914", "W0102", "W0212", "W0511", "W0613", "W0621", "W0707", "W0718", "W0719", "R0801", "R0917"]
4 changes: 2 additions & 2 deletions tests/e2e/utils/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def run_oc(
args: list[str], input=None, ignore_existing_resource=False # noqa: A002
args: list[str], command=None, ignore_existing_resource=False
) -> subprocess.CompletedProcess:
"""Run a command in the OpenShift cluster."""
try:
Expand All @@ -18,7 +18,7 @@ def run_oc(
capture_output=True,
text=True,
check=True,
input=input,
input=command,
)
return res
except subprocess.CalledProcessError as e:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/utils/ols_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def update_ols_config() -> None:
updated_configmap = yaml.dump(configmap)

cluster_utils.run_oc(["delete", "configmap", "olsconfig"])
cluster_utils.run_oc(["apply", "-f", "-"], input=updated_configmap)
cluster_utils.run_oc(["apply", "-f", "-"], command=updated_configmap)


def replace_ols_image(ols_image: str) -> None:
Expand Down
4 changes: 3 additions & 1 deletion tests/mock_classes/mock_llm_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __init__(self, *args, **kwargs):
def __call__(self, *args, **kwargs):
return retval

def invoke(self, input, config=None, **kwargs): # noqa: A002
def invoke(
self, input, config=None, **kwargs # noqa: A002 pylint: disable=W0622
):
"""Perform invocation of the LLM chain."""
if retval is not None:
return retval
Expand Down

0 comments on commit 1a6e1a1

Please sign in to comment.