Skip to content

Add option for default_charset to sql.write_frame #5008

Closed
@aschilling

Description

@aschilling

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO SQLto_sql, read_sql, read_sql_queryUnicodeUnicode strings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions