Skip to content

Commit

Permalink
chore: Avoid unnecessary assignment before for-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 28, 2024
1 parent 875b39d commit a77fac5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ocdsindex/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def copy(host, source, destination):

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"]:
for hit in es.search(index=index, size=10000, query={"term": {"base_url": source}})["hits"]["hits"]:
document = hit["_source"]
for field in ("url", "base_url"):
document[field] = document[field].replace(source, destination)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ target-version = "py39"
select = ["ALL"]
ignore = [
"ANN", "C901", "COM812", "D203", "D212", "D415", "EM", "ISC001", "PERF203", "PLR091", "Q000",
"D1",
"D1", "D205",
"PLR2004", # magic
"PTH",
]
Expand Down

0 comments on commit a77fac5

Please sign in to comment.