Skip to content

BUG: Change IntervalDtype.kind from None to "O" #30569

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
Dec 31, 2019

Conversation

jschendel
Copy link
Member

This is partially blocking #28399 as tests are failing there due to kind being None.

cc @TomAugspurger

@jschendel jschendel added Bug Dtype Conversions Unexpected or buggy dtype conversions Interval Interval data type labels Dec 30, 2019
@jschendel jschendel added this to the 1.0 milestone Dec 30, 2019
@jbrockmendel
Copy link
Member

could add a test to the interface tests requiring that dtype.kind be a 1-character str?

@jschendel
Copy link
Member Author

There's an existing test for dtype.kind that allows for it to be None but otherwise checks that it's one of the valid single character string values:

def test_kind(self, dtype):
valid = set("biufcmMOSUV")
if dtype.kind is not None:
assert dtype.kind in valid

I removed the if block and all the tests are passing for me locally, so I've pushed the change here too. Not sure if there's a specific reason it was written that way and we'd want to allow None though, so can revert if we want to still allow it. Given that None can cause things to break I think we'd want to disallow it though.

@TomAugspurger TomAugspurger merged commit c068313 into pandas-dev:master Dec 31, 2019
@TomAugspurger
Copy link
Contributor

Thanks!

@jschendel jschendel deleted the interval-dtype-kind branch December 31, 2019 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Interval Interval data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: IntervalDtype.kind should be "O" instead of None
3 participants