Skip to content

Conversation

jorisvandenbossche
Copy link
Member

Closes #8624

Use .get_values() instead of .values on the block,
this ensures that NonConsolidatable blocks (non-dense
blocks like categorical or sparse) are densified
instead of just returning the raw .values.

@jorisvandenbossche jorisvandenbossche added the IO SQL to_sql, read_sql, read_sql_query label Oct 30, 2014
@jorisvandenbossche jorisvandenbossche added this to the 0.15.1 milestone Oct 30, 2014
@jreback
Copy link
Contributor

jreback commented Oct 30, 2014

needs big doc note that these are converted to object on serialization (to reading back does NOT generate a categorical)

@jorisvandenbossche
Copy link
Member Author

yes, OK, in the io.rst docs for sql?

@jreback
Copy link
Contributor

jreback commented Oct 30, 2014

needs big doc note that these are converted to object on serialization (to reading back does NOT generate a categorical)

Use .get_values() instead of .values on the block,
this ensures that NonConsolidatable blocks (non-dense
blocks like categorical or sparse) are densified
instead of just returning the raw .values
@jorisvandenbossche
Copy link
Member Author

@jreback added a doc note.

jorisvandenbossche added a commit that referenced this pull request Oct 31, 2014
BUG: fix writing of Categorical with to_sql (GH8624)
@jorisvandenbossche jorisvandenbossche merged commit 387c9bf into pandas-dev:master Oct 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IO SQL to_sql, read_sql, read_sql_query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pd.to/read_sql_table silently corrupts Categorical columns

2 participants