Start here
The safe first move
When the root entity is obvious, replace the string path with the mapped attribute, like User.addresses or User.orders.
Stop before automation when: Multi-hop joins like join("orders", "items"). Alias-heavy query builders.
Target shape
query = session.query(User).join(User.addresses)
query = query.outerjoin(User.orders)