Skip to content

BUG: IntNA division can alter array inplace #27829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jbrockmendel opened this issue Aug 8, 2019 · 2 comments · Fixed by #30183
Closed

BUG: IntNA division can alter array inplace #27829

jbrockmendel opened this issue Aug 8, 2019 · 2 comments · Fixed by #30183
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@jbrockmendel
Copy link
Member

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

@jreback
Copy link
Contributor

jreback commented Aug 8, 2019

hmm this looks buggy then as we shouldn’t alter inplace (not sure if this shows up in the wild)

@jbrockmendel jbrockmendel added Bug ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations labels Aug 10, 2019
@ruddyscent
Copy link

ruddyscent commented Aug 15, 2019

I'm working on it at PyCon Korea 2019 Sprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants