Skip to content
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

BUG: disallow scalar in Categorical constructor #38472

Merged
merged 8 commits into from Dec 23, 2020

Conversation

jbrockmendel
Copy link
Member

@jorisvandenbossche
Copy link
Member

We could also easily deprecate this first. I don't know if others would rely on it, but at least we did ourselves (the behaviour was explicitly tested)

@jreback jreback added the Categorical Categorical Data Type label Dec 16, 2020
@jreback
Copy link
Contributor

jreback commented Dec 16, 2020

indifferent here. am ok pushing this thru or deprecating.

@jreback jreback added the Constructors Series/DataFrame/Index/pd.array Constructors label Dec 16, 2020
@jreback
Copy link
Contributor

jreback commented Dec 22, 2020

doesn't this duplicate #38614 (or vice versa)

@jbrockmendel
Copy link
Member Author

doesn't this duplicate #38614 (or vice versa)

no. one is for Categorical, the other for CategoricalIndex

@jreback
Copy link
Contributor

jreback commented Dec 22, 2020

doesn't this duplicate #38614 (or vice versa)

no. one is for Categorical, the other for CategoricalIndex

ok.

should we deprecate this? i agree its very weird, but i suppose it might happen in the real world.

@jorisvandenbossche
Copy link
Member

Given that we had tests for it, and that it is actually also allowed for Series, I would go for deprecation first (it shouldn't be hard I think?)

@jreback jreback added this to the 1.3 milestone Dec 22, 2020
@jreback jreback added the Deprecate Functionality to remove in pandas label Dec 22, 2020
@jreback jreback merged commit a20dd5c into pandas-dev:master Dec 23, 2020
@jbrockmendel jbrockmendel deleted the ref-cast-7 branch December 23, 2020 19:18
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Constructors Series/DataFrame/Index/pd.array Constructors Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG/API: allowing scalars in Categorical constructor
3 participants