on 32bit -- Series is int64 but cut produces int32 series #14866

Closed
yarikoptic opened this Issue Dec 12, 2016 · 6 comments

Comments

Projects
None yet
2 participants
Contributor

yarikoptic commented Dec 12, 2016

Code Sample, a copy-pastable example if possible

failing on 32bit test

    def test_single_bin(self):
        # issue 14652
        expected = Series([0, 0])

        s = Series([9., 9.])
        result = cut(s, 1, labels=False)
        tm.assert_series_equal(result, expected)

        s = Series([-9., -9.])
        result = cut(s, 1, labels=False)
        tm.assert_series_equal(result, expected)

Problem description

orig: https://buildd.debian.org/status/fetch.php?pkg=pandas&arch=i386&ver=0.19.1%2Bgit174-g81a2f79-1&stamp=1481436461 (still don't know about "bad argument to internal function" -- can't replicate locally, so ignore for this one):

======================================================================
FAIL: test_single_bin (pandas.tools.tests.test_tile.TestCut)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/tools/tests/test_tile.py", line 281, in test_single_bin
    tm.assert_series_equal(result, expected)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 1154, in assert_series_equal
    assert_attr_equal('dtype', left, right)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 878, in assert_attr_equal
    left_attr, right_attr)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 1018, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: Attributes are different

Attribute "dtype" are different
[left]:  int32
[right]: int64
(Pdb) p expected
0    0
1    0
dtype: int64
(Pdb) p result
0    0
1    0
dtype: int32
(Pdb) p s
0    9.0
1    9.0
dtype: float64

so I guess if Series should use int64 regardless of underlying architecture default type, then cut should also produce int64, I guess.... or should Series have arch-default int??

Contributor

jreback commented Dec 12, 2016

hmm, this should always be int64. (btw this is a new tests in 0.19.2-dev)

Contributor

yarikoptic commented Dec 12, 2016

re new tests: yeap -- trying to build current master thus version is 0.19.1+git174-g81a2f79 to correspond to 81a2f79 (count of commits 174 is off since counted since 0.19.0, since 0.19.1 was released from the release branch, so current master is not a child of it)

Contributor

jreback commented Dec 12, 2016

yeah for some reason our git describe is off, not really sure why

Contributor

jreback commented Dec 12, 2016

normally things like this would show up on windows, but this is ok there.

Contributor

yarikoptic commented Dec 14, 2016

so what should we do about this one? on my end I know only asmuch as do astype in the test to workaround ;)

Contributor

jreback commented Dec 14, 2016

@yarikoptic if you want to debug and see where the 32bit is coming from, great. we don't test on 32-bit systems any longer.

jreback added this to the 0.20.0 milestone Jan 9, 2017

teh referenced this issue in NixOS/nixpkgs Mar 1, 2017

Closed

Zero Hydra Failures for 17.03 #23253

0 of 50 tasks complete

jreback added the 32bit label Mar 17, 2017

@jreback jreback added a commit to jreback/pandas that referenced this issue Mar 21, 2017

@jreback jreback BUG: cut/qcut should always return int64 bins
closes #14866
54505d1

@jreback jreback added a commit to jreback/pandas that referenced this issue Mar 21, 2017

@jreback jreback BUG: cut/qcut should always return int64 bins
closes #14866
1bb2f60

jreback closed this in aa9d0cf Mar 21, 2017

@mattip mattip added a commit to mattip/pandas that referenced this issue Apr 3, 2017

@jreback @mattip jreback + mattip BUG: various 32bit compat issues
closes #14866    xref #14183

Author: Jeff Reback <jeff@reback.net>

Closes #15766 from jreback/32bit and squashes the following commits:

93c03e3 [Jeff Reback] BUG: 32bit compat for .get_indexer
4163918 [Jeff Reback] BUG: fix isin for 32bit platform issues
1bb2f60 [Jeff Reback] BUG: cut/qcut should always return int64 bins
a706880

@linebp linebp added a commit to linebp/pandas that referenced this issue Apr 17, 2017

@jreback @linebp jreback + linebp BUG: various 32bit compat issues
closes #14866    xref #14183

Author: Jeff Reback <jeff@reback.net>

Closes #15766 from jreback/32bit and squashes the following commits:

93c03e3 [Jeff Reback] BUG: 32bit compat for .get_indexer
4163918 [Jeff Reback] BUG: fix isin for 32bit platform issues
1bb2f60 [Jeff Reback] BUG: cut/qcut should always return int64 bins
6f71d7b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment