Skip to content

CLN/REF: Split up / clean Categorical constructor tests #32211

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 6 commits into from
Feb 25, 2020
Merged

CLN/REF: Split up / clean Categorical constructor tests #32211

merged 6 commits into from
Feb 25, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Feb 23, 2020

No description provided.

dtype = CategoricalDtype(categories=["a", "b", "c"])

# empty codes should not raise for floats
Categorical.from_codes([], dtype.categories)
Copy link
Member

Choose a reason for hiding this comment

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

did this get lost or moved?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had removed that because it seemed duplicative given that we have a test_constructor_empty test. Looking now I see that it isn't using from_codes so I can add another test for that specifically.

dtype = CategoricalDtype(categories=["a", "b", "c"])

# empty codes should not raise for floats
Copy link
Member

Choose a reason for hiding this comment

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

can you retain this comment and the one on L552 describing the choice of parametrizations

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean the inline comments from L540 and L552? This comment (L543) I find a little confusing because we're testing an empty list rather than an empty float array

Copy link
Member

Choose a reason for hiding this comment

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

thanks

@jbrockmendel
Copy link
Member

LGTM pending green (the failure is unrelated, but id rather be patient all the same)

@dsaxton
Copy link
Member Author

dsaxton commented Feb 25, 2020

@jbrockmendel Looks like we're green after fixing CI, thanks for the review

@jbrockmendel jbrockmendel merged commit 2eca9e8 into pandas-dev:master Feb 25, 2020
@jbrockmendel
Copy link
Member

thanks @dsaxton

@dsaxton dsaxton deleted the split-tests branch February 25, 2020 23:44
roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
…2211)

* Split / parametrize

* Dedupe some code

* Parametrize

* Add back from_codes for empty

* Add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants