Skip to content

TST: Fix 36 maybe_promote xfails wanting np.bytes_ instead of np.object_ #28861

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 3 commits into from
Oct 11, 2019

Conversation

jbrockmendel
Copy link
Member

@jreback less trivial than some of the others. These changes are based on my understanding that maybe_promote should never be returning np.bytes_ dtype; those cases all become np.object_. That is what maybe_promote currently does, and this updates the tests to expect that behavior.

@jreback
Copy link
Contributor

jreback commented Oct 9, 2019

we should never have bytes as these are not a pandas supported dtype; anything that is not a standard (str, int, float, m8, M8 etc, or EA dtype) would just promote to object

bytes are not special in that regard

@jbrockmendel
Copy link
Member Author

we should never have bytes as these are not a pandas supported dtype

agreed, that matches what this PR does. The xfailed tests that this fixes do not match what you said

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm @jreback

@WillAyd WillAyd added Clean Dtype Conversions Unexpected or buggy dtype conversions labels Oct 10, 2019
@WillAyd WillAyd added this to the 1.0 milestone Oct 10, 2019
else:
pytest.xfail("wrong missing value marker")
else:
if not issubclass(dtype.type, np.bytes_):
Copy link
Contributor

Choose a reason for hiding this comment

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

could enhance / make new test that uses an object here (e.g. list / tuple), IOW something that is treated similarly but is not also a numpy dtype. (future PR)

@jreback jreback merged commit 0474c7f into pandas-dev:master Oct 11, 2019
@jreback
Copy link
Contributor

jreback commented Oct 11, 2019

thanks

@jbrockmendel jbrockmendel deleted the maybe_promote14 branch October 11, 2019 15:30
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
Clean Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants