From 148d57d4416b861badd15142f19611c9e43092fa Mon Sep 17 00:00:00 2001 From: niek mereu Date: Wed, 24 Jul 2024 12:00:22 +0200 Subject: [PATCH] style: flake8 --- .pre-commit-config.yaml | 9 +++++---- osman/osman.py | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ea1401..271d1b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/osman/osman.py b/osman/osman.py index a6729bc..dbd4465 100644 --- a/osman/osman.py +++ b/osman/osman.py @@ -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"] ) @@ -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 @@ -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" )