Skip to content

ExtensionDtype.construct_array_type is not optional #24860

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions