Fix ruff warning - use direct attribute access instead of getattr
Some checks failed
CI/CD / lint-and-test (push) Failing after 14s
Some checks failed
CI/CD / lint-and-test (push) Failing after 14s
This commit is contained in:
@@ -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__"):
|
||||||
|
|||||||
Reference in New Issue
Block a user