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

TST: Review if we are really testing with different locales #23923

Closed
datapythonista opened this issue Nov 26, 2018 · 4 comments · Fixed by #24632
Closed

TST: Review if we are really testing with different locales #23923

datapythonista opened this issue Nov 26, 2018 · 4 comments · Fixed by #24632
Labels
Bug CI Continuous Integration Testing pandas testing functions or related to the test suite
Milestone

Comments

@datapythonista
Copy link
Member

In the scripts for the CI, we set the locale with:

export LC_ALL="$LOCALE_OVERRIDE";
export LANG="$LOCALE_OVERRIDE";

and immediately later we display the locale detected by pandas:

pycmd='import pandas; print("pandas detected console encoding: %s" % pandas.get_option("display.encoding"))'
python -c "$pycmd"

(see https://github.com/pandas-dev/pandas/blob/master/ci/script_single.sh#L5)

Checking the logs, I can see how in the two builds where we specify locales, the output is:

# Linux py37_locale
2018-11-25T20:35:30.0051096Z Setting LC_ALL and LANG to zh_CN.UTF-8
2018-11-25T20:35:31.0423116Z pandas detected console encoding: UTF-8

and

# Linux py36_locale_slow
2018-11-25T20:37:45.3938178Z Setting LC_ALL and LANG to it_IT.UTF-8
2018-11-25T20:37:46.4791772Z pandas detected console encoding: UTF-8

And also in Travis:

# 2.7, locale, slow, old NumPy
Setting LC_ALL and LANG to zh_CN.UTF-8
pandas detected console encoding: UTF-8

I checked the logs for the PR #23908 but I assume all are the same.

If I'm not misunderstanding anything, I think pandas is not detecting the locale we want to test with, and it's testing with the default UTF8 locale, as in the rest of the tests.

CC: @jreback @TomAugspurger

@datapythonista datapythonista added Bug Testing pandas testing functions or related to the test suite CI Continuous Integration labels Nov 26, 2018
@jreback
Copy link
Contributor

jreback commented Nov 26, 2018

@datapythonista
Copy link
Member Author

not sure I understand. Isn't pandas.get_option("display.encoding") expected to output zh_CN.UTF-8 in that travis job? In line 1805 of the link you provided is returning UTF-8 instead.

@gfyoung
Copy link
Member

gfyoung commented Jan 22, 2019

@datapythonista : I know it's been a couple of months since there was chatter in this issue, but do you mind checking the most recent master builds?

I took a glance, and I didn't see the locale complaints that you were seeing before...

@datapythonista
Copy link
Member Author

I think this was working well in travis, where one of the set up scripts was editing the pandas __init__.py and changing the locale there. But that wasn't implemented in Azure (or CircleCI before), where only the environment variable was defined.

This is unified in #24632. And should work after this is merged. Thanks for pointing out, I'll add this issue there, so it gets automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CI Continuous Integration Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants