Skip to content

TST: Add test for categorical with str and tuples #28693

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 1 commit into from
Oct 6, 2019

Conversation

has2k1
Copy link
Contributor

@has2k1 has2k1 commented Sep 30, 2019

The bug is not present any more.

@pep8speaks
Copy link

pep8speaks commented Sep 30, 2019

Hello @has2k1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-10-06 18:02:10 UTC

@has2k1 has2k1 force-pushed the mixed-type-categorical branch from 01c8f2d to af67e31 Compare September 30, 2019 20:13
@has2k1
Copy link
Contributor Author

has2k1 commented Oct 1, 2019

This bug affects numpy versions 1.13.3 to 1.15.4. Versions greater than 1.16.0 are fine. However, since it was a regression in numpy (e.g. 1.11.0 is okay), I do not know if it will not show up again.

The tests are failing for lower versions of numpy.

@topper-123
Copy link
Contributor

To check for different versions of numpy, you need to skipif using the ``compat.numpy._np_version_under1p*` bools.

@has2k1 has2k1 force-pushed the mixed-type-categorical branch from af67e31 to a3b6b3d Compare October 4, 2019 21:31
# For NumPy <1.16, np.array(["", ("a",)]) raises
# ValueError: setting an array element with a sequence.
if _np_version_under1p16:
raise pytest.skip("Skipping for NumPy <1.16")
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to decorate the test method with @pytest.mark.skipif( _np_version_under1p16, reason="Skipping for NumPy <1.16").

@has2k1 has2k1 force-pushed the mixed-type-categorical branch from a3b6b3d to 2a77b7a Compare October 5, 2019 20:22
@has2k1 has2k1 force-pushed the mixed-type-categorical branch from 2a77b7a to 09d58a9 Compare October 6, 2019 18:02
@topper-123 topper-123 merged commit 15d2d4a into pandas-dev:master Oct 6, 2019
@topper-123 topper-123 added Categorical Categorical Data Type Testing pandas testing functions or related to the test suite labels Oct 6, 2019
@topper-123 topper-123 added this to the 1.0 milestone Oct 6, 2019
@topper-123
Copy link
Contributor

Thanks, @has2k1!

proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Cannot create Categorial of mixed dtypes/tuples if first element is not a tuple
3 participants