Raise TypeError("Query must be a string unless using sqlalchemy.")

Thanks - see a link to a reply on a similar question of mine.

Apparently, the following versions now work:
streamlit==1.31.1, SQLAlchemy==2.0.27