I am very confused with the way charset and encoding work in SQLAlchemy. I understand (and have read) the difference between charsets and encodings, and I h
encoding parameter does not work correctly.
encoding
So, as @doru said in this link, you should add ?charset=utf8mb4 at the end of the connection string. like this:
?charset=utf8mb4
connect_string = 'mysql+pymysql://{}:{}@{}:{}/{}?charset=utf8mb4'.format(DB_USER, DB_PASS, DB_HOST, DB_PORT, DATABASE)