Skip to content

BUG: Failing eval tests on OS X #5118

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

Closed
jtratner opened this issue Oct 5, 2013 · 16 comments
Closed

BUG: Failing eval tests on OS X #5118

jtratner opened this issue Oct 5, 2013 · 16 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jtratner
Copy link
Contributor

jtratner commented Oct 5, 2013

These two tests fail (note the warning that it generates, happens in one other place but the test passes).

pandas.computation.tests.test_eval.TestAlignment.test_basic_series_frame_alignment('numexpr', 'python') ... /Users/jtratner/scratch/pandas/pandas/core/index.py:900: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  result.sort()
FAIL
pandas.computation.tests.test_eval.TestAlignment.test_basic_series_frame_alignment('numexpr', 'pandas') ... FAIL

Traceback:

FAIL: pandas.computation.tests.test_eval:TestAlignment.test_basic_series_frame_alignment('numexpr', 'python')
  /usr/local/bin/vim +872 pandas/computation/tests/test_eval.py  # check_basic_series_frame_alignment
    testit(r_idx_type, c_idx_type, index_name)
  /usr/local/bin/vim +867 pandas/computation/tests/test_eval.py  # testit
    assert_frame_equal(res, expected)
  /usr/local/bin/vim +312 pandas/util/testing.py  # assert_frame_equal
    assert_index_equal(left.columns, right.columns)
  /usr/local/bin/vim +192 pandas/util/testing.py  # assert_index_equal
    right.dtype))
AssertionError: [index] left [object Index([1, 2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 
2, 4, 3, 0, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00], dtype=object)], 
right [Index([2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2000-01-06 00:00:00, 
2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00, 0, 1, 2, 3, 4], dtype=object) object]

FAIL: pandas.computation.tests.test_eval:TestAlignment.test_basic_series_frame_alignment('numexpr', 'pandas')
  /usr/local/bin/vim +872 pandas/computation/tests/test_eval.py  # check_basic_series_frame_alignment
    testit(r_idx_type, c_idx_type, index_name)
  /usr/local/bin/vim +867 pandas/computation/tests/test_eval.py  # testit
    assert_frame_equal(res, expected)
  /usr/local/bin/vim +312 pandas/util/testing.py  # assert_frame_equal
    assert_index_equal(left.columns, right.columns)
  /usr/local/bin/vim +192 pandas/util/testing.py  # assert_index_equal
    right.dtype))
AssertionError: [index] left [object Index([1, 2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 
2, 4, 3, 0, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00], dtype=object)], 
right [Index([2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2000-01-06 00:00:00, 
2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00, 0, 1, 2, 3, 4], dtype=object) object]
@cpcloud
Copy link
Member

cpcloud commented Oct 5, 2013

@jtratner want to take this one? happy to help .... i just don't have a mac to test on ...

@jtratner
Copy link
Contributor Author

jtratner commented Oct 6, 2013

@TomAugspurger - do you see this when you run the eval test suite? (or even just the tp_compare error)

@TomAugspurger
Copy link
Contributor

I got these two warnings:

(statsmodels)Toms-MacBook-Pro:pandas tom$ sh test_fast.sh 
/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/core/index.py:902: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  result.sort()
/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/numpy/core/fromnumeric.py:595: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  a.sort(axis, kind, order)

and the end of the output:

======================================================================
FAIL: pandas.computation.tests.test_eval.TestAlignment.test_basic_series_frame_alignment('numexpr', 'python')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/computation/tests/test_eval.py", line 872, in check_basic_series_frame_alignment
    testit(r_idx_type, c_idx_type, index_name)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/computation/tests/test_eval.py", line 867, in testit
    assert_frame_equal(res, expected)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/util/testing.py", line 312, in assert_frame_equal
    assert_index_equal(left.columns, right.columns)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/util/testing.py", line 192, in assert_index_equal
    right.dtype))
AssertionError: [index] left [object Index([1, 2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2, 4, 3, 0, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00], dtype=object)], right [Index([2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00, 0, 1, 2, 3, 4], dtype=object) object]

======================================================================
FAIL: pandas.computation.tests.test_eval.TestAlignment.test_basic_series_frame_alignment('numexpr', 'pandas')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/computation/tests/test_eval.py", line 872, in check_basic_series_frame_alignment
    testit(r_idx_type, c_idx_type, index_name)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/computation/tests/test_eval.py", line 867, in testit
    assert_frame_equal(res, expected)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/util/testing.py", line 312, in assert_frame_equal
    assert_index_equal(left.columns, right.columns)
  File "/Users/tom/Envs/statsmodels/lib/python2.7/site-packages/pandas/pandas/util/testing.py", line 192, in assert_index_equal
    right.dtype))
AssertionError: [index] left [object Index([1, 2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2, 4, 3, 0, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00], dtype=object)], right [Index([2000-01-03 00:00:00, 2000-01-04 00:00:00, 2000-01-05 00:00:00, 2000-01-06 00:00:00, 2000-01-07 00:00:00, 2000-01-10 00:00:00, 2000-01-11 00:00:00, 0, 1, 2, 3, 4], dtype=object) object]

@jtratner
Copy link
Contributor Author

jtratner commented Oct 6, 2013

Well at least we have more evidence that it's an OSX-specific problem now (instead of just my setup). Thanks for running it!

@TomAugspurger
Copy link
Contributor

This was on pandas 0.12.0-751-gbea5051 and numpy 1.7.1 btw.

@cpcloud
Copy link
Member

cpcloud commented Oct 6, 2013

yeah ... not sure why it passes on my machine (linux box) since the sort fails on both linux and mac. let me take a look

@jtratner
Copy link
Contributor Author

jtratner commented Oct 6, 2013

@cpcloud and we really have a more minimal example that will fail more clearly

from pandas import *
tm = util.testing
with tm.assert_produces_warning(False):
    try:
        arr = np.array([Timestamp(n) for n in range(10)] + range(10))
        arr.sort()
    except:
        pass

@cpcloud
Copy link
Member

cpcloud commented Oct 6, 2013

@jreback @TomAugspurger I'm assuming that fails for you both, even though it passes on my end

@jtratner
Copy link
Contributor Author

jtratner commented Oct 6, 2013

That fails like this for me:

AssertionError: Caused unexpected warning(s): ['RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning', 'RuntimeWarning'].

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

@cpcloud any idea what's going on here?

@jtratner
Copy link
Contributor Author

Last we left this, the issue was that it was doing a numpy inplace sort, but because the objects are not comparable it leaves it in an inconsistent state between architectures and sort methods (not a numpy bug, just the result of sorting inplace and raising an Exception at some point). Should we just eliminate the test case, given that it doesn't really make sense?

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

@cpcloud this is the combine a datetimeindex and an intindex. I thought we are raising on this? (unless you actually add them)

@jtratner
Copy link
Contributor Author

It should raise, because it doesn't really make sense.

@jreback
Copy link
Contributor

jreback commented Oct 14, 2013

@cpcloud ?

@jreback
Copy link
Contributor

jreback commented Oct 16, 2013

is this still reproducing?

@cpcloud
Copy link
Member

cpcloud commented Oct 16, 2013

this is the same as #5039 ... closing

@cpcloud cpcloud closed this as completed Oct 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

4 participants