Skip to content

BUG: ExtensionArray.equals expects ExtensionArray.all to return a numpy.bool_ #34660

Closed
@xhochy

Description

@xhochy
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Problem description

The current implementation of ExtensionArray.equals expects that the implementation of ExtensionArray.all always returns a numpy scalar, see

return (equal_values | equal_na).all().item()
. If you don't use numpy as the backing memory store, I don't it is reasonable to stick to NumPy scalars here.

Instead, the method should unpack numpy scalars if necessary but passthrough otherwise.

Context: This appeared while running the unit tests with fletcher and pandas' master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions