I tried in Apr 2025:
Pandas version: 1.5.3
Numpy version: 1.21.6
Sqlalchemy version: 1.4.54
tablename.tosql() function working fine