Skip to content

TST: fix ujson's intermittently failing date unit test #4592

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

Merged
merged 1 commit into from
Aug 17, 2013

Conversation

Komnomnomnom
Copy link
Contributor

Fixes #4575.

As you surmised @jreback it looks like unnecessary float arithmetic was causing the test failure. I fixed this up and in the interest of consistency removed the dependence on datetime.now()

Example

In [8]: val = 1376774232215504000

In [9]: val / 1000
Out[9]: 1376774232215504

In [10]: val / 1e3
Out[10]: 1376774232215503.8

In [11]: val // 1e3
Out[11]: 1376774232215503.0

In [12]: val / 1000.0
Out[12]: 1376774232215503.8

In [13]: val / 10**3
Out[13]: 1376774232215504

@jreback
Copy link
Contributor

jreback commented Aug 17, 2013

merge?

@Komnomnomnom
Copy link
Contributor Author

Yep, good to go. Passes for me on Python 2 & 3

jreback added a commit that referenced this pull request Aug 17, 2013
TST: fix ujson's intermittently failing date unit test
@jreback jreback merged commit 4c8ad82 into pandas-dev:master Aug 17, 2013
@jreback
Copy link
Contributor

jreback commented Aug 17, 2013

thanks you sir!

@Komnomnomnom Komnomnomnom deleted the ujson-date-explosion branch August 17, 2013 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: sometimes failing ujson comparison
2 participants