-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: fix DecimalArray._reduce kludges #29630
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
Conversation
pandas/core/groupby/ops.py
Outdated
# np.bool_(False) when we have all-NA DecimalArray | ||
if group.isna().all(): | ||
res = group.dtype.na_value | ||
result[label] = res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to why this is the correct fix. You are changing the result of the function, without necessarily knowing what the function is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yah, i want to take another shot at fixing this behavior inside DecimalArray.__array_whatever__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tentatively looks like a fix in DecimalArray._reduce
gets the job done, so the change here has been reverted. We'll see if the CI agrees.
try: | ||
return cls(scalars) | ||
except TypeError: | ||
# handling int 0 is necessary for groupby tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this is necessary? What is a code example running into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is made unnecessary by the fix i just pushed, so has been reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. @jorisvandenbossche
@jorisvandenbossche gentle ping |
* TST: fix DecimalArray._reduce kludges
* TST: fix DecimalArray._reduce kludges
No description provided.