Add option for default_charset to sql.write_frame · Issue #5008 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Hi everybody,
I worked today with a lot of unicode data and deeply missed the option to define a default_charset when writing a dataframe to a new sql table. I did not know that pandas uses "latin-1" as default and ran into various strange encoding problems such as "Data too long for column" when inserting my unicode data. The exception was raised despite the explicit definition of utf-8 in the connection object.
As a workaround I created the table myself and let pandas only append the DataFrame. However, it would be much better if pandas could create the tables itself.
Best regards
Andy