-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ExtensionDtype.construct_array_type is not optional #24860
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
Labels
ExtensionArray
Extending pandas with custom dtypes or arrays.
Comments
yeah this should probably be a required element of an EA Dtype |
Yeah, OK to require it.
…On Mon, Jan 21, 2019 at 8:19 AM Joris Van den Bossche < ***@***.***> wrote:
Currently, the ExtensionDtype docstring says:
Optionally one can override construct_array_type for construction
with the name of this dtype via the Registry. See
:meth:`pandas.api.extensions.register_extension_dtype`.
* construct_array_type
However, it seems that in practice this is used for more than just
supporting string dtypes. Eg I also need to implement it to have groupby
working.
Eg cyberpandas does not yet implement it, and there
df.groupby('ipaddresses').size() fails with a NotImplementedError.
I assume we are fine with requiring this (assuming a 1-1 mapping of dtype
and array), and a doc update is enough?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24860>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIhOz-O2u_Dzc1kl1Y3PoA_tpxEdsks5vFcxngaJpZM4aK6pH>
.
|
I see the usefulness here, but there is a non-trivial downside that this prevents core.dtypes from being self-contained (w/r/t the rest of core). |
I'm now fully on board with this. Is it just a matter of updating the docstring? |
And I suppose changing the implementation from NotImplementedError to AbstractMethodError ? |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
ExtensionDtype
docstring says:However, it seems that in practice this is used for more than just supporting string dtypes. Eg I also need to implement it to have
groupby
working.Eg cyberpandas does not yet implement it, and there
df.groupby('ipaddresses').size()
fails with a NotImplementedError.I assume we are fine with requiring this (assuming a 1-1 mapping of dtype and array), and a doc update is enough?
The text was updated successfully, but these errors were encountered: