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

BLD: Nosetests failures on 32-bit (test_first_last_nth_dtypes, test_iloc_getitem_array) #3143

Closed
stephenwlin opened this issue Mar 23, 2013 · 17 comments

Comments

@stephenwlin
Copy link
Contributor

I'm getting them on two different 32-bit ubuntu machines updated to master (0.11.0.dev-5f2ec15)...I'm guessing these are 32-bit specific since they're dtype related:

======================================================================
FAIL: test_first_last_nth_dtypes (pandas.tests.test_groupby.TestGroupBy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stephen/Projects/pandas/pandas/tests/test_groupby.py", line 176, in test_first_last_nth_dtypes
    assert_frame_equal(first, expected, check_names=False)
  File "/home/stephen/Projects/pandas/pandas/util/testing.py", line 217, in assert_frame_equal
    check_less_precise=check_less_precise)
  File "/home/stephen/Projects/pandas/pandas/util/testing.py", line 185, in assert_series_equal
    assert(left.dtype == right.dtype)
AssertionError

======================================================================
FAIL: test_iloc_getitem_array (pandas.tests.test_indexing.TestIndexing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stephen/Projects/pandas/pandas/tests/test_indexing.py", line 345, in test_iloc_getitem_array
    self.check_result('array like', 'iloc', s.index, 'ix', { 0 : [2,4,6], 1 : [3,6,9], 2: [4,8,12] }, typs = ['ints'])
  File "/home/stephen/Projects/pandas/pandas/tests/test_indexing.py", line 249, in check_result
    _eq(t, o, a, obj, key1, k2)
  File "/home/stephen/Projects/pandas/pandas/tests/test_indexing.py", line 206, in _eq
    raise AssertionError(_print('type error'))
AssertionError: None

I can look into this and resolve this myself if no one else does, but just wanted to throw it out there first (knee deep in other stuff atm...)

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

this is master on 32 bit - latest commit?

these have 2 do with int64 being casted

I'll take a look

weird that Travis does not fail

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

e04a239

seems to be working on 32 and 64 bit.....

which commit is the issue on ?

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

ahah it DID show up on a fresh install of 32-bit! really odd...looking

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

@stephenwlin

the groupby error I have fixed, was not specifying the correct platform comparison (using np.int_ rather than issubclass np.integer),

the 2nd is more complicated (failing in the test_indexing)

lots of places to step thru, but ultiatemly failing on an ndarray take!
I have reduced to this case, maybe an edge case on the new optimization?

In fact this is failing (but only 32-bit!)

from pandas.core.index import Int64Index
x = Int64Index([1, 2, 3], dtype='int64')
y = Int64Index([0, 3, 6, 9], dtype='int64')
y.take(x)
*** TypeError: array cannot be safely cast to required type

@jreback jreback closed this as completed Mar 23, 2013
@jreback jreback reopened this Mar 23, 2013
@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

#3144 should fix the groupby issue

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

This works...so maybe the platform indexer conversion?
(which is called on the indexer before being passed in)

This is what take is actually doing.

y.take(com._ensure_platform_int(x))
In [20]: y.take(np.array([1,2,3]))
Out[20]: Int64Index([3, 6, 9], dtype=int64)

In [21]: np.array([1,2,3])
Out[21]: array([1, 2, 3])

In [22]: np.array([1,2,3]).dtype
Out[22]: dtype('int32')

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

ok....I modified Int64Index to actually use its dtype parameter if its passed (which as far as I can tell is ONLY when an astype in _ensure_platform_int), and added a couple of tests in test_common.py.

I think maybe this 'worked', on 32-bit except in a pathological case, which is weird why a fresh install doesn't work.

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

@stephenwlin

ok I update master, confirmed fresh installs on 32/64 are ok.....pls verify when you have a chance

@stephenwlin
Copy link
Contributor Author

yep, ok now, still getting that test_operators_timedelta64 one reported at #3094 though

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

really, on fresh 32-bit build, on latest master?

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

what numpy do you use?

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

hmm...2.7 with 1.7.0 numpy not tested on travis.....I think that is the culprit!

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

I think I can install that

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

and of course that's there they messed with timedelta64 (well they were broken in 1.6.2)

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

repro the error....

@stephenwlin
Copy link
Contributor Author

should probably follow-up on #3094 and delete all this here

@jreback
Copy link
Contributor

jreback commented Mar 23, 2013

@stephenwlin sorry meant here

@jreback jreback closed this as completed Mar 23, 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

No branches or pull requests

2 participants