Hi, I had the same issue. I upgraded sqlalchemy to version v.2.0.27 (latest as of today), which fixed this issue. streamlit==1.31.1, SQLAlchemy==2.0.27
Unfortunately, my app was live, so I had already made the change to psycopg2 to get something working.
I’ll have a look at switching back though as I’ve been having random operational errors when using @st_cache_resource on my deployed app (streamlit cloud) when using psycopg2.connect().