Start here
The safe first move
Open an explicit connection, wrap raw SQL in text(...), and pass the Connection into code that still expects an executable object.
Stop before automation when: Transaction boundaries around writes. Third-party libraries that need version-compatible adapters.
Target shape
from sqlalchemy import text
with engine.connect() as conn:
rows = pd.read_sql_query(text("SELECT id FROM users"), conn)
result = conn.execution_options(stream_results=True).execute(stmt)