Skip to content

should fix issue #7520, test_nanargmin fails with datetime64 objects #7535

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
Jun 21, 2014
Merged

should fix issue #7520, test_nanargmin fails with datetime64 objects #7535

merged 1 commit into from
Jun 21, 2014

Conversation

toddrjen
Copy link
Contributor

I think this will fix the issue #7520. The issue appears to be that older versions of numpy, probably less than 1.7.0, can't handle datetime64 dtypes very well. I have added simple check to see if numpy can handle a standard operation with datetime64 dtypes, and if not it skips those tests.

I can't test this personally since I don't have the older version of numpy.

@jreback
Copy link
Contributor

jreback commented Jun 21, 2014

all datetime64/timesela64 HAVE TO be cast to i8 before operations (and cast back after)

it is an assertion error if this is not the case

@jreback
Copy link
Contributor

jreback commented Jun 21, 2014

you can simply set up a virtual env to test numpy 1.6.1

@toddrjen
Copy link
Contributor Author

Yes, nanops casts internally. The problem with this bug is with the reference function. All the nanops tests compare to a reference function to make sure the calculations are correct. In this case, it is a numpy function. The current version of the numpy function, and the version that travis tests against, handle datetime64 objects fine. Older versions, however, apparently don't.

So this change just tests the numpy reference function and if it fails, it skips the test.

@jreback
Copy link
Contributor

jreback commented Jun 21, 2014

that's fine then

jreback added a commit that referenced this pull request Jun 21, 2014
should fix issue #7520, test_nanargmin fails with datetime64 objects
@jreback jreback merged commit 1aefd4a into pandas-dev:master Jun 21, 2014
@toddrjen toddrjen deleted the nandatetime branch June 26, 2014 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants