-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
BUG(string dtype): Empty sum produces incorrect result #60936
base: main
Are you sure you want to change the base?
Conversation
Friendly ping @WillAyd @jorisvandenbossche |
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.
Looks pretty good - minor question
if op.how == "sum": | ||
# https://github.com/pandas-dev/pandas/issues/60229 | ||
# All NA should result in the empty string. | ||
assert "skipna" in kwargs |
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.
What is the need for assert here?
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.
We should always be adding skipna to kwargs by the time we get here. If that doesn't happen for some reason (e.g. a future refactor), it can help debugging as an assert failing indicates a clear violation of an assumption, key error perhaps not. If it did somehow end up in a release with user code raising, an assert also indicates to the user "this is clearly a bug in pandas".
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.
@WillAyd - friendly ping
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.