Skip to content

BUG: Categorical Series breaks when re-serializing with msgpack. #14901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jreback opened this issue Dec 17, 2016 · 1 comment
Closed

BUG: Categorical Series breaks when re-serializing with msgpack. #14901

jreback opened this issue Dec 17, 2016 · 1 comment
Labels
Bug Categorical Categorical Data Type
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 17, 2016

xref #8732

df=pd.DataFrame([[1,'John P. Doe'],[2,'Jane Dove'],[1,'John P. Doe']])
df[1]=pd.Categorical(df[1])

DataFrames work fine

In [9]: pd.read_msgpack(df.to_msgpack()).dtypes
Out[9]: 
0       int64
1    category
dtype: object

Series are breaking on re-serialization

In [10]: pd.read_msgpack(df[1].to_msgpack())
ValueError: cannot specify a dtype with a Categorical unless dtype='category'
@jreback jreback added this to the Next Major Release milestone Dec 17, 2016
@jreback
Copy link
Contributor Author

jreback commented Dec 17, 2016

cc @iorilu

gfyoung added a commit to forking-repos/pandas that referenced this issue Dec 19, 2016
Patches bug in read_msgpack in which
Series categoricals were accidentally
being constructed with a non-categorical
dtype, resulting in an error.

Closes pandas-devgh-14901.
gfyoung added a commit to forking-repos/pandas that referenced this issue Dec 19, 2016
Patches bug in read_msgpack in which
Series categoricals were accidentally
being constructed with a non-categorical
dtype, resulting in an error.

Closes pandas-devgh-14901.
@jreback jreback modified the milestones: 0.20.0, Next Major Release Dec 19, 2016
gfyoung added a commit to forking-repos/pandas that referenced this issue Dec 21, 2016
Patches bug in read_msgpack in which
Series categoricals were accidentally
being constructed with a non-categorical
dtype, resulting in an error.

Closes pandas-devgh-14901.
jreback pushed a commit that referenced this issue Dec 21, 2016
Patches bug in read_msgpack in which
Series categoricals were accidentally
being constructed with a non-categorical
dtype, resulting in an error.

Closes gh-14901.
ShaharBental pushed a commit to ShaharBental/pandas that referenced this issue Dec 26, 2016
Patches bug in read_msgpack in which
Series categoricals were accidentally
being constructed with a non-categorical
dtype, resulting in an error.

Closes pandas-devgh-14901.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Categorical Categorical Data Type
Projects
None yet
Development

No branches or pull requests

1 participant