Skip to content

Commit eadb33a

Browse files
committed
When using only the values of a dict use the values() method
1 parent 413994d commit eadb33a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

infrahub_sdk/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _get(self, key: str, kind: Optional[Union[str, type[SchemaType]]] = None, ra
5858
if kind_name and kind_name in self._store and key in self._store[kind_name]: # type: ignore[attr-defined]
5959
return self._store[kind_name][key] # type: ignore[attr-defined]
6060

61-
for _, item in self._store.items(): # type: ignore[attr-defined]
61+
for item in self._store.values(): # type: ignore[attr-defined]
6262
if key in item:
6363
return item[key]
6464

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ ignore = [
234234
"FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups
235235
"N802", # Function name should be lowercase
236236
"N806", # Variable in function should be lowercase
237-
"PERF102", # When using only the values of a dict use the `values()` method
238237
"PERF203", # `try`-`except` within a loop incurs performance overhead
239238
"PERF401", # Use a list comprehension to create a transformed list
240239
"PLC0206", # Extracting value from dictionary without calling `.items()`

0 commit comments

Comments
 (0)