I've now resolved this. User comments are correct in that the quoted warning was not what was causing the code to fail; it was actually this, further down in the output:
AttributeError: 'Engine' object has no attribute 'connection'
This seems to have been caused by an upgrade in the version of Pandas I was using; apparently the correct syntax for connections has been changed in Pandas 2.2 and up. For more details see here: Pandas to_sql to sqlite returns 'Engine' object has no attribute 'cursor'