Skip to content

BUG: pivot_table with EA dtype that cannot hold NA #55484

Open
@jbrockmendel

Description

@jbrockmendel

Speculative: in _add_margins there is a snippet

        if isinstance(dtype, ExtensionDtype):
            # Can hold NA already
            continue

This seems to assume that the dtype will have dtype._can_hold_na, but that is not actually required of ExtensionDtypes. The task here is to implement a test case that gets here with an ExtensionDtype that cannot hold na, make sure it doesn't break things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNA - MaskedArraysRelated to pd.NA and nullable extension arraysReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions