Skip to content

ABCClasses for DatetimeArray etc? #21895

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 Jul 13, 2018 · 3 comments
Closed

ABCClasses for DatetimeArray etc? #21895

jbrockmendel opened this issue Jul 13, 2018 · 3 comments
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.

Comments

@jbrockmendel
Copy link
Member

There are a handful of places in the code where we check for for isinstance(other, ABCDatetimeIndex) or getattr(other, '_typ', None) == "datetimeindex" (and analogous places for TDI, PI). In most of these cases DatetimeArray/TimedeltaArray/PeriodArray should be handled symmetrically. Thoughts on what _typs to give them?

@jreback
Copy link
Contributor

jreback commented Jul 13, 2018

we don’t have this notion for EA but we either should or alternatively just use isinstancs o the EA (iow don’t define ABCs

but if it makes it simpler i would make an ABC hierarchy that is distinct from the current ones

@jbrockmendel
Copy link
Member Author

Well there is an ABCExtensionArray. For some of it we can probably get away with changing e.g isinstance(foo, ABCPeriodIndex) to is_period_dtype(foo). The cython cases that explicitly check _typ will need special handling.

@gfyoung gfyoung added the ExtensionArray Extending pandas with custom dtypes or arrays. label Jul 16, 2018
@jbrockmendel
Copy link
Member Author

Closed by #23502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

No branches or pull requests

3 participants