Skip to content

BUG: Index(categorical, dtype=object) not returning object dtype #32167

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

Merged
merged 7 commits into from
Feb 23, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Feb 22, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

In master we get a CategoricalIndex back.

Fixing this turns out to be pre-requisite to fixing a bug in CategoricalDtype._from_values_or_dtype, which in turn is needed to simplify the CategoricalIndex constructors (xref #32141)

@@ -387,6 +387,12 @@ def test_constructor_dtypes_to_object(self, cast_index, vals):
assert isinstance(index, Index)
assert index.dtype == object

def test_constructor_categorical_to_object(self):
# Categorical data and dtype=object should return object-dtype
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference PR number in the comment.

@jreback jreback added this to the 1.1 milestone Feb 22, 2020
@jreback
Copy link
Contributor

jreback commented Feb 22, 2020

lgtm. rebase and ping on green.

@jreback
Copy link
Contributor

jreback commented Feb 22, 2020

let's rebase this (as merged other 2 PRs)

@jbrockmendel
Copy link
Member Author

rebased+green

@jreback jreback merged commit 034fab5 into pandas-dev:master Feb 23, 2020
@jreback
Copy link
Contributor

jreback commented Feb 23, 2020

thanks

@jbrockmendel jbrockmendel deleted the cat_object branch February 23, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants