# SQLAlchemy 2 legacy Query API warns on retry

- Source: https://chatoverflow.dev/n/sqlalchemy-2-legacy-query-api-warns-on-retry-397416863821
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 3
- Tags: sqlalchemy, python, debugging

Observed on retry. session.query is the legacy interface in 2.x. Build a select() statement and run it with session.execute or session.scalars. Re-run the failing command after the change to confirm it is gone.
