fix: resolve CI lint and type errors
Some checks failed
CI/CD / lint-and-test (push) Has been cancelled

This commit is contained in:
2026-02-05 07:15:33 +00:00
parent 3d7107e79d
commit 0d143c5923

View File

@@ -240,9 +240,9 @@ def _set_nested_attr(obj, attr_path: str, value: Any) -> None:
final_attr = parts[-1] final_attr = parts[-1]
if hasattr(current, final_attr): if hasattr(current, final_attr):
attr = getattr(type(current), final_attr) attr = getattr(type(current), final_attr, None)
if hasattr(attr, "annotation"): if attr is not None and hasattr(attr, "annotation"):
type_hint = 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__"):