Skip to content
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: behaviour of skipna=None changed on master #44178

Closed
3 tasks done
mathause opened this issue Oct 25, 2021 · 3 comments · Fixed by #44579
Closed
3 tasks done

BUG: behaviour of skipna=None changed on master #44178

mathause opened this issue Oct 25, 2021 · 3 comments · Fixed by #44579
Labels
Enhancement Error Reporting Incorrect or improved errors from pandas Reduction Operations sum, mean, min, max, etc.
Milestone

Comments

@mathause
Copy link
Contributor

mathause commented Oct 25, 2021

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of pandas.
  • I have confirmed this bug exists on the master branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np
pd.Series([1.7, 0.5, np.nan]).sum(skipna=None)

Issue Description

In pandas 1.3.4 the example returns 2.2 on nightly it returns nan.

This lead to a test failure in xarray (we use pandas to double check a result - so we get a wrong expected value & could fix this but I still think this should not change silently).

Expected Behavior

I think this should still return 2.2 or raise a deprecation warning or an error.

Installed Versions

pandas was installed from scipy-wheels-nightly:

python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple --no-deps --pre --upgrade --force-reinstall  pandas

INSTALLED VERSIONS

commit : 9018d32
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.11.0-38-generic
Version : #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.4.0.dev0+972.g9018d327de
numpy : 1.20.3
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.2.0
Cython : None
pytest : 6.2.5
hypothesis : 6.24.0
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.28.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : 1.3.2
fsspec : 2021.10.1
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : 2.7.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : None
tables : None
tabulate : None
xarray : 0.19.1.dev89+gfdabf3be
xlrd : None
xlwt : None
numba : 0.54.1

@mathause mathause added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 25, 2021
@jbrockmendel
Copy link
Member

xref #43980

@mathause
Copy link
Contributor Author

Thanks! Yes this silently changes the behavior of skipna=None. Feel free to close this issue if you think this does not warrant a deprecation cycle. I'll update the test in xarray.

@jreback
Copy link
Contributor

jreback commented Oct 26, 2021

actually we should validate bool value eg a None should raise as it's not a valid value

@mroeschke mroeschke added Enhancement Error Reporting Incorrect or improved errors from pandas Reduction Operations sum, mean, min, max, etc. and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 30, 2021
@jreback jreback added this to the 1.4 milestone Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Error Reporting Incorrect or improved errors from pandas Reduction Operations sum, mean, min, max, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants