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: Work-around a numpy regression affecting pandas.eval() with numexpr #5666

Merged
merged 2 commits into from Dec 9, 2013

Conversation

@neirbowj
Copy link
Contributor

commented Dec 9, 2013

numpy 1.7.0 erroneously raises IndexError instead of ValueError
from ndarray.item() when the array is not of length 1. This can be
seen as a failure of

computation.tests.test_eval.TestScope.test_global_scope

for the cases that engine='numexpr'.

Absorb the splatter from this regression by explicitly catching the
erroneous IndexError.

closes #5535.

BUG: Work-around a numpy regression
numpy 1.7.0 erroneously raises IndexError instead of ValueError
from ndarray.item() when the array is not of length 1. This can be
seen as a failure of

    computation.tests.test_eval.TestScope.test_global_scope

for the cases that engine='numexpr'.

Absorb the splatter from this regression by explicitly catching the
erroneous IndexError.
@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

weird that this is only on FreeBSD. any idea why?

@neirbowj

This comment has been minimized.

Copy link
Contributor Author

commented Dec 9, 2013

I don't think it is actually limited to FreeBSD. The affected code in numpy does not appear to be platform-dependent. I think that we just didn't see test failures, because as far as I can tell (5f4be91, 81739d9) we've never actually encountered the affected version of numpy in the Travis-CI environment. The fix was backported to the 1.7.x maintenance branch prior to 1.7.1 (numpy/numpy@b84555a).

@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

ahh that makes sense

but this is a fix for a version that is already fixed then in numpy, why is it necessary to fix something that doesn't occur?

@neirbowj

This comment has been minimized.

Copy link
Contributor Author

commented Dec 9, 2013

It does occur if you're in an environment where 1.7.0 is present, like FreeBSD. Pandas may decide not to accept this patch as a matter of policy (e.g. we don't support numpy 1.7.0), in which case I could elect to apply the patch to the FreeBSD port. My aim, though, is to minimize the diff between the ported software and the published releases, so I would like to see this patch accepted.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

@neirbowj

maybe I was not clear. Is the current numpy 1.7.0 patched? you said it was back ported? Or if you happend to have an 'older' numpy 1.7.0 then it (obviously) does not have the back port.

@neirbowj

This comment has been minimized.

Copy link
Contributor Author

commented Dec 9, 2013

@jreback

Ah, I see now. No, numpy 1.7.0 does not have the fix and is broken. 1.7.1 is fixed and 1.8.0 is fixed.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

ahh..ok...then i don't see a problem with this (as it seems to work with 1.7.1/1.8 which we test)...

thanks for the fix

@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

can you add a release note referecing the issue?

jreback added a commit that referenced this pull request Dec 9, 2013
Merge pull request #5666 from neirbowj/numpy_regression
BUG: Work-around a numpy regression affecting pandas.eval() with numexpr

@jreback jreback merged commit b3e25a0 into pandas-dev:master Dec 9, 2013

1 check passed

default The Travis CI build passed
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

thanks for the fix!

@neirbowj neirbowj deleted the neirbowj:numpy_regression branch Dec 9, 2013

@ghost

This comment has been minimized.

Copy link

commented Dec 10, 2013

@neirbowj, are you in a position to put up a freebsd CI server / buildbot for us to track?

@neirbowj

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2013

@y-p, That's a compelling possibility. I will look into it.

TomAugspurger added a commit to TomAugspurger/pandas that referenced this pull request Dec 14, 2013
@neirbowj neirbowj referenced this pull request Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.