From eadb33a5b4d9d1b822b2d9c26324c319ce31b116 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Sat, 2 Nov 2024 09:36:37 +0100 Subject: [PATCH] When using only the values of a dict use the `values()` method --- infrahub_sdk/store.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/infrahub_sdk/store.py b/infrahub_sdk/store.py index 4bf5e0cb..fe5ba48c 100644 --- a/infrahub_sdk/store.py +++ b/infrahub_sdk/store.py @@ -58,7 +58,7 @@ def _get(self, key: str, kind: Optional[Union[str, type[SchemaType]]] = None, ra if kind_name and kind_name in self._store and key in self._store[kind_name]: # type: ignore[attr-defined] return self._store[kind_name][key] # type: ignore[attr-defined] - for _, item in self._store.items(): # type: ignore[attr-defined] + for item in self._store.values(): # type: ignore[attr-defined] if key in item: return item[key] diff --git a/pyproject.toml b/pyproject.toml index 4289d7e2..3694f9ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -234,7 +234,6 @@ ignore = [ "FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups "N802", # Function name should be lowercase "N806", # Variable in function should be lowercase - "PERF102", # When using only the values of a dict use the `values()` method "PERF203", # `try`-`except` within a loop incurs performance overhead "PERF401", # Use a list comprehension to create a transformed list "PLC0206", # Extracting value from dictionary without calling `.items()`