Skip to content

is_datetimelike treatment of PeriodDtype inconsistent #23914

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

Closed
jbrockmendel opened this issue Nov 25, 2018 · 1 comment · Fixed by #29452
Closed

is_datetimelike treatment of PeriodDtype inconsistent #23914

jbrockmendel opened this issue Nov 25, 2018 · 1 comment · Fixed by #29452
Labels
Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@jbrockmendel
Copy link
Member

xref #22137

def is_datetimelike(arr):
    """ [...] """    
    return (is_datetime64_dtype(arr) or is_datetime64tz_dtype(arr) or
            is_timedelta64_dtype(arr) or
            isinstance(arr, ABCPeriodIndex) or
            is_datetimetz(arr))

is_datetimetz is AFAICT redundant with is_datetime64tz_dtype, so ignore that part for now. Shouldn't the ABCPeriodIndex check be the more general is_period_dtype? Or for that matter, is_period_arraylike?

cc: @TomAugspurger

@gfyoung gfyoung added the Dtype Conversions Unexpected or buggy dtype conversions label Nov 26, 2018
@TomAugspurger
Copy link
Contributor

Yeah, we shouldn't be special casing PeriodIndex there.

@jreback jreback added this to the 1.0 milestone Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants