fix: infer scalar SQLAlchemy association proxy types
HA
13h ago+187+187+012345678901234567890123456789-8-8-0123456789
Summary
- Infer scalar SQLAlchemy association proxies from the proxied attribute's type, preserving list inference for collection proxies.
- Resolve the proxied attribute by its declared name so annotated properties and chained proxies also work.
- Populate scalar proxy values from the serialized relationship so the frontend receives them without lazy-loading the model.
- Cover the optional state Var from the issue, along with numeric operations, object indexing, nullable values, and collection proxies.
Verification
- Reproduced the reported
.upper()failure onmainand verified that the same example compiles with the fix. - Ran the attribute inference, Var, and SQLAlchemy unit tests on Python 3.11 and 3.14.
- Verified in Chromium that a state update renders
ADAthroughState.user.profile_name.upper()using the default serializer.
Closes #8043.