Skip to content

BUG: pandas/tests/arrays/floating/test_construction.py:test_floating_array_disallows_float16 fails on de_CH locale #45013

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
3 tasks done
burnpanck opened this issue Dec 22, 2021 · 3 comments
Labels
Bug Localization Internationalization of data Unreliable Test Unit tests that occasionally fail

Comments

@burnpanck
Copy link
Contributor

Pandas version checks

  • 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

pytest pandas/tests/arrays/floating/test_construction.py

Issue Description

Running the current test-suite with the current locale set to de_CH fails due to the that specific test marking itself as xfail unless the locale is en_US. However, the test actually passes.

Expected Behavior

The full test-suite passes under any system locale - specifically also de_CH.

Installed Versions

INSTALLED VERSIONS ------------------ commit : 3a4821e python : 3.9.8.final.0 python-bits : 64 OS : Darwin OS-release : 21.1.0 Version : Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 machine : arm64 processor : arm byteorder : little LC_ALL : de_CH.UTF-8 LANG : en_GB.UTF-8 LOCALE : de_CH.UTF-8

pandas : 1.4.0.dev0+1446.g3a4821e055
numpy : 1.20.3
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.1.0
Cython : 0.29.26
pytest : 6.2.5
hypothesis : 6.31.6
sphinx : None
blosc : 1.10.6
feather : None
xlsxwriter : None
lxml.etree : 4.7.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 7.30.1
pandas_datareader: None
bs4 : 4.10.0
bottleneck : None
fsspec : 2021.11.1
fastparquet : 0.7.2
gcsfs : None
matplotlib : None
numexpr : 2.8.1
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : 6.0.1
pyxlsb : None
s3fs : 2021.11.1
scipy : 1.7.3
sqlalchemy : 1.4.28
tables : 3.6.1
tabulate : None
xarray : 0.20.2
xlrd : None
xlwt : None
numba : None

@burnpanck burnpanck added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 22, 2021
@burnpanck
Copy link
Contributor Author

The issue probably started with merging PR #44715 - there is a bit of discussion on this topic over there.

@simonjayhawkins simonjayhawkins added Unreliable Test Unit tests that occasionally fail and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 22, 2021
@mroeschke mroeschke added the Localization Internationalization of data label Nov 21, 2023
@mroeschke
Copy link
Member

Unfortunately we are unable to account for all locals in the test suite since it's optimize to pass the CI so closing as wont fix.

@burnpanck
Copy link
Contributor Author

Of course it's not feasible to write accurate tests for all locales, but that doesn't mean the test have to xfail! Why not just allow failures if the locale is not en_US? Basically, the way the tests are setup here does actually say "we know the outcome of this test for every locale; success for en_US, and failure for any other". That is directly against what you say, namely that you don't intend to make claims about other locales. Having tests fail wrongly on contributor's machines just discourages us from testing our contributions in the first place.
Now, the issue here is pretty old, and I'm not currently contributing on any issue, so it may not be relevant anymore, but IMHO, completely ignoring any other locale than the CI-blessed one is not good practice - especially, because this issue here is likely easily fixable in the sense of just disabling locale-dependent tests rather than xfailing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Localization Internationalization of data Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

No branches or pull requests

3 participants