Assume only two columns(name and id) are needed from a table. I would code something like below:
session.query(User.id, User.name).all()
Bu
You can get use of select():
from sqlalchemy.sql import select columns = ['id', 'name'] print(session.query(select(from_obj=User, columns=columns)).all())
Hope that helps.