Skip to content

BUG: cumulative functions with ea dtype not handling NA correctly and casting to object #39483

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
wants to merge 4 commits into from

Conversation

phofl
Copy link
Member

@phofl phofl commented Jan 30, 2021

@phofl phofl added the NA - MaskedArrays Related to pd.NA and nullable extension arrays label Jan 30, 2021
@@ -1728,12 +1731,27 @@ def na_accum_func(values: ArrayLike, accum_func, *, skipna: bool) -> ArrayLike:
result, dtype=orig_dtype
)

elif skipna and not issubclass(values.dtype.type, (np.integer, np.bool_)):
elif (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think maybe ok to have is_ea_dtype be a separate elif; much easier to rationalize here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do it like that

@jorisvandenbossche
Copy link
Member

More general solution is being worked on in #28509 (which doesn't mean a short term solution can't be merged, I didn't closely look at either PR, just noting)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2021

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Mar 6, 2021
vals[mask] = mask_a
result = accum_func(vals, axis=0)
result[mask_copy] = mask_b
result = sanitize_array(result, None, values.dtype)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanitize_array is relatively heavy-weight. what cases is it handling?

@simonjayhawkins
Copy link
Member

More general solution is being worked on in #28509 (which doesn't mean a short term solution can't be merged, I didn't closely look at either PR, just noting)

@phofl can you resolve conflicts

@simonjayhawkins
Copy link
Member

@phofl closing as stale. #39483 (comment) needs addressing. reopen when ready.

@phofl phofl deleted the 39479 branch April 27, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: cumsum() shows inconsistent results in nullable dtype
5 participants