Skip to content

BUG: IntNA division can alter array inplace #27829

Closed
@jbrockmendel

Description

@jbrockmendel

IntegerArray._maybe_mask_result starts with:

if is_float_dtype(result):
     mask |= (result == np.inf) | (result == -np.inf)

but in many cases, mask will be self._mask, so it gets altered inplace. The intuitive solution is to add a check for mask is self._mask and make a copy, but that turns out to break 32 tests, so somewhere we're relying on this incorrect behavior.

cc @jreback

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugExtensionArrayExtending pandas with custom dtypes or arrays.Numeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions