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
Merged

BUG: Work-around a numpy regression affecting pandas.eval() with numexpr #5666

merged 2 commits into from
Dec 9, 2013

Conversation

neirbowj
Copy link
Contributor

@neirbowj neirbowj 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.

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
Copy link
Contributor

jreback commented Dec 9, 2013

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

@neirbowj
Copy link
Contributor Author

neirbowj 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 (5f4be91f, 81739d9c) 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@b84555ac).

@jreback
Copy link
Contributor

jreback 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
Copy link
Contributor Author

neirbowj 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
Copy link
Contributor

jreback 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
Copy link
Contributor Author

neirbowj 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
Copy link
Contributor

jreback 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
Copy link
Contributor

jreback 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
BUG: Work-around a numpy regression affecting pandas.eval() with numexpr
@jreback jreback merged commit b3e25a0 into pandas-dev:master Dec 9, 2013
@jreback
Copy link
Contributor

jreback commented Dec 9, 2013

thanks for the fix!

@neirbowj neirbowj deleted the numpy_regression branch December 9, 2013 20:22
@ghost
Copy link

ghost commented Dec 10, 2013

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

@neirbowj
Copy link
Contributor Author

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

TomAugspurger pushed a commit to TomAugspurger/pandas that referenced this pull request Dec 14, 2013
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.

computation.tests.test_eval.TestScope.test_global_scope generates errors with numexpr engine and numpy 1.7.0
2 participants