Skip to content

Add ExtesnsionDtype.empty classmethod #19600

Closed
@TomAugspurger

Description

@TomAugspurger

This would let us provide a default construct_from_string method.

It seems we could have a default implementation for ExtensionDtype.construct_from_string ? (I now just copy pasted from the decimal example, and I think json example also has the same basic one)

The default would have to rely on ExtensionDtype() being constructable with no arguments, or an ExtensionDtype.empty method. For many that'll be

@classmethod
def empty(cls):
    return cls()

which is easier than implementing construct_from_string. Maybe call it from_empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.InternalsRelated to non-user accessible pandas implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions