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

COMPAT: 32-bit compat fixes mainly in testing #13584

Closed
wants to merge 1 commit into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Jul 8, 2016

closes #13566

@jreback jreback added Testing pandas testing functions or related to the test suite Compat pandas objects compatability with Numpy or Python functions labels Jul 8, 2016
@jreback jreback added this to the 0.18.2 milestone Jul 8, 2016
@jreback
Copy link
Contributor Author

jreback commented Jul 8, 2016

this was a PITA

cc @jorisvandenbossche
cc @sinhrks
cc @gfyoung

passing on 32-bit linux & windows & travis.

@gfyoung
Copy link
Member

gfyoung commented Jul 8, 2016

@jreback : any reason why we don't test 32-bit for PR's? Our parent library numpy has at least one machine for 32-bit testing as you can see here.

@jreback
Copy link
Contributor Author

jreback commented Jul 8, 2016

oh didn't know you could set it up that way

sure u want to add another build (under the bottom section - go for it)

@gfyoung
Copy link
Member

gfyoung commented Jul 8, 2016

There's a little bit more that happens behind the scenes, but I just wanted to throw that out there. I can certainly take a look.

@jorisvandenbossche
Copy link
Member

What is the reason searchsorted has to return platform int?

@gfyoung
Copy link
Member

gfyoung commented Jul 8, 2016

Alas, adding a 32-bit config is way more complicated than I imagined (I thought perhaps Ctrl+P from numpy might suffice, but alas, that doesn't even work). So tabling that idea for now.

@jreback
Copy link
Contributor Author

jreback commented Jul 8, 2016

32-bit linux

In [12]: arr = np.array([0,1,2])

In [13]: arr.dtype
Out[13]: dtype('int32')

In [14]: arr.searchsorted(arr).dtype
Out[14]: dtype('int32')

64-bit windows

In [15]: arr = np.array([0,1,2])

In [16]: arr.dtype
Out[16]: dtype('int32')

In [17]: arr.searchsorted(arr)
Out[17]: array([0, 1, 2], dtype=int64)

64-bit all around / OSX

In [1]: arr = np.array([0,1,2])

In [2]: arr.searchsorted(arr)
Out[2]: array([0, 1, 2])

In [3]: arr.searchsorted(arr).dtype
Out[3]: dtype('int64')

In [4]: arr.dtype
Out[4]: dtype('int64')

So the issue is that on 64-bit we have integers defaults to 64-bit upon construction, and indexing routines (e.g. .searchsorted and .take are also 64-bit)
On 32-bit these are both 32-bit
on windows indexing are 64-bit but 32-bit for integer defaults (this is because windows use long long for pointers, but long for integer)

Note that this is NOT an API change, rather a regression to 0.18.1 (so putting it back where it was). Will update soon.

I think somewhere we are doing a forced conversion (in .searchsorted) but should not be.

@codecov-io
Copy link

codecov-io commented Jul 8, 2016

Current coverage is 84.31%

Merging #13584 into master will not change coverage

@@             master     #13584   diff @@
==========================================
  Files           138        138          
  Lines         51155      51155          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43130      43130          
  Misses         8025       8025          
  Partials          0          0          

Powered by Codecov. Last updated by 2655dae...b624ce0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failures on 32-bit Linux
4 participants