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: Remove locale conversion from Stata file date #15208

Closed
wants to merge 1 commit into from

Conversation

bashtage
Copy link
Contributor

@bashtage bashtage commented Jan 24, 2017

Prevent locale from affecting Stata file date creation, which must
be en_US.

xref #13856

  • tests added / passed
  • passes git diff upstream/master | flake8 --diff
  • whatsnew entry

@bashtage
Copy link
Contributor Author

Does not close any issue since this was only identified as part of #13856.

Passes all tests (not just slow) when locale is zh_CN.utf8. This config is not enabled by default.

month_lookup = {i + 1: month for i, month in enumerate(months)}
ts = (time_stamp.strftime("%d ") +
month_lookup[time_stamp.month] +
time_stamp.strftime(" %Y %H:%M"))
Copy link
Contributor

@jreback jreback Jan 24, 2017

Choose a reason for hiding this comment

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

you could also

with pandas.util.testing.set_locale('en_US.UTF-8'):
    ....

not sure if this is better though

@jreback jreback added IO Stata read_stata, to_stata Bug labels Jan 24, 2017
@jreback
Copy link
Contributor

jreback commented Jan 24, 2017

https://travis-ci.org/jreback/pandas/jobs/194872508

oddly this didn't fail on py3.

@codecov-io
Copy link

codecov-io commented Jan 24, 2017

Current coverage is 85.99% (diff: 100%)

No coverage report found for master at 9309eba.

Powered by Codecov. Last update 9309eba...a23a92f

@jreback
Copy link
Contributor

jreback commented Jan 24, 2017

can you rebase and push again, just to make sure this passes? ping on green.

@jreback jreback added this to the 0.20.0 milestone Jan 24, 2017
Prevent locale from affecting Stata file date creation, which must
be en_US.

xref pandas-dev#13856
@bashtage
Copy link
Contributor Author

@jreback Green - one test fails in another module that has the same problem due to locales.

https://travis-ci.org/pandas-dev/pandas/jobs/194970098

@jreback jreback closed this in 3ad978a Jan 25, 2017
@jreback
Copy link
Contributor

jreback commented Jan 25, 2017

thanks for the fix @bashtage

@bashtage bashtage deleted the stata-locale-date-fix branch February 17, 2017 18:58
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
Prevent locale from affecting Stata file date creation, which must  be
en_US.

xref pandas-dev#13856

Author: Kevin Sheppard <kevin.k.sheppard@gmail.com>

Closes pandas-dev#15208 from bashtage/stata-locale-date-fix and squashes the following commits:

a55bfd8 [Kevin Sheppard] BUG: Remove locale conversion from Stata file date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Stata read_stata, to_stata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants