From 048e6683bdd03af314e6c7e9a7ba01925c59500e Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:53:45 -0400 Subject: [PATCH] chore: Fix PLW2901 --- ocdsindex/__main__.py | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ocdsindex/__main__.py b/ocdsindex/__main__.py index f97d141..aea973f 100644 --- a/ocdsindex/__main__.py +++ b/ocdsindex/__main__.py @@ -121,8 +121,8 @@ def copy(host, source, destination): with connect(host) as es: body = [] - for result in es.cat.indices(format="json"): - index = result["index"] + for index_result in es.cat.indices(format="json"): + index = index_result["index"] result = es.search(index=index, size=10000, query={"term": {"base_url": source}}) for hit in result["hits"]["hits"]: document = hit["_source"] @@ -147,9 +147,9 @@ def expire(host, exclude_file): base_urls = [line.strip() for line in exclude_file] if exclude_file else [] with connect(host) as es: - for result in es.cat.indices(format="json"): + for index_result in es.cat.indices(format="json"): es.delete_by_query( - index=result["index"], + index=index_result["index"], query={ "bool": { "must": { diff --git a/pyproject.toml b/pyproject.toml index 5d3da1b..b2ea815 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ target-version = "py39" select = ["ALL"] ignore = [ "ANN", "C901", "COM812", "D203", "D212", "D415", "EM", "PERF203", "PLR091", "Q000", - "PLR2004", "PLW2901", "D100", "D103", "D104", "D205", + "PLR2004", "D100", "D103", "D104", "D205", "PTH", ]