Skip to content

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

Merged
merged 4 commits into from
Nov 18, 2019

Conversation

jbrockmendel
Copy link
Member

No description provided.

# np.bool_(False) when we have all-NA DecimalArray
if group.isna().all():
res = group.dtype.na_value
result[label] = res
Copy link
Member

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?

Copy link
Member Author

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__

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. labels Nov 16, 2019
@jreback jreback added this to the 1.0 milestone Nov 16, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

@jbrockmendel
Copy link
Member Author

@jorisvandenbossche gentle ping

@TomAugspurger TomAugspurger merged commit e246c3b into pandas-dev:master Nov 18, 2019
@jbrockmendel jbrockmendel deleted the decimal branch November 18, 2019 20:02
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* TST: fix DecimalArray._reduce kludges
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* TST: fix DecimalArray._reduce kludges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants