Fix ruff warning - use direct attribute access instead of getattr
Some checks failed
CI/CD / lint-and-test (push) Failing after 14s

This commit is contained in:
2026-02-05 07:08:57 +00:00
parent 07f2a768f8
commit da1a064831

View File

@@ -242,7 +242,7 @@ def _set_nested_attr(obj, attr_path: str, value: Any) -> None:
if hasattr(current, final_attr): if hasattr(current, final_attr):
attr = getattr(type(current), final_attr, None) attr = getattr(type(current), final_attr, None)
if attr is not None and hasattr(attr, "annotation"): if attr is not None and hasattr(attr, "annotation"):
type_hint = getattr(attr, "annotation") type_hint = attr.annotation # type: ignore[attr-defined]
if getattr(type_hint, "__origin__", None) is Union: if getattr(type_hint, "__origin__", None) is Union:
type_hint = type_hint.__args__[0] type_hint = type_hint.__args__[0]
if hasattr(type_hint, "__name__"): if hasattr(type_hint, "__name__"):