Skip to content

Commit

Permalink
style: flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
niek-mereu committed Jul 24, 2024
1 parent dfbedf2 commit 148d57d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ repos:
- id: debug-statements

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.11.5
rev: 5.11.5
hooks:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 7.1.0
hooks:
- id: flake8

additional_dependencies:
- wemake-python-styleguide==0.18.0
6 changes: 2 additions & 4 deletions osman/osman.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ def upload_search_template(

# if script exists in os, compare it with the local script
if script_os_res["found"]:

diffs = _compare_scripts(
json.dumps(source), script_os_res["script"]["source"]
)
Expand Down Expand Up @@ -486,7 +485,6 @@ def debug_search_template(
ids = [hit.get("_id") for hit in hits]

if expected_ids is not None:

assert set(ids) == set(expected_ids)

return hits
Expand Down Expand Up @@ -618,13 +616,13 @@ def debug_painless_script(
dictionary with response
"""
if context_type == "score":
if type(expected_result) not in {float, int}:
if not isinstance(expected_result, {float, int}):
logging.warning(
"context_type 'score' requires 'expected_result' float or int"
)
return {"acknowledged": False}
elif context_type == "filter":
if type(expected_result) != bool:
if not isinstance(expected_result, (bool)):
logging.warning(
"context_type 'filter' requires 'expected_result' bool"
)
Expand Down

0 comments on commit 148d57d

Please sign in to comment.