Switched from session.query to session.execute.