-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: #14345 fixes TestDatetimeIndexOps test_nat AssertionErrors on 32-bit #14347
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
Conversation
tm.assert_numpy_array_equal(idx._nan_idxs, | ||
np.array([1], dtype=np.int64)) | ||
# def test_nat(self): | ||
# self.assertIs(pd.TimedeltaIndex._na_value, pd.NaT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what the heck are you commenting out a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's incorrect it should be deleted (but it's not)
it can be skipped on paticular platforms if needed
but this should work on 32bit
idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02'], tz=tz) | ||
self.assertTrue(idx._can_hold_na) | ||
|
||
tm.assert_numpy_array_equal(idx._isnan, np.array([False, False])) | ||
self.assertFalse(idx.hasnans) | ||
tm.assert_numpy_array_equal(idx._nan_idxs, | ||
np.array([], dtype=np.int64)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls don't change the formatting unless it's germane (this line is too long anyhow)
self.assertIs(pd.PeriodIndex([], freq='M')._na_value, pd.NaT) | ||
|
||
idx = pd.PeriodIndex(['2011-01-01', '2011-01-02'], freq='D') | ||
self.assertTrue(idx._can_hold_na) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that forgot i commented those out when i was figuring out the error.
I installed pandas on 32bit ubuntu, ran all the nosetests and keep getting that AssertionError.
Should i change it to intp or leave it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intp is correct
@@ -857,25 +857,26 @@ def test_shift(self): | |||
tm.assert_index_equal(idx.shift(-3, freq='H'), exp) | |||
|
|||
def test_nat(self): | |||
self.assertIs(pd.DatetimeIndex._na_value, pd.NaT) | |||
self.assertIs(pd.DatetimeIndex._na_value, pd.NaT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert whitespace changes.
self.assertIs(pd.DatetimeIndex([])._na_value, pd.NaT) | ||
|
||
for tz in [None, 'US/Eastern', 'UTC']: | ||
idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02'], tz=tz) | ||
self.assertTrue(idx._can_hold_na) | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
tm.assert_numpy_array_equal(idx._nan_idxs, | ||
np.array([], dtype=np.int64)) | ||
|
||
tm.assert_numpy_array_equal(idx._nan_idxs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you seem to be adding whitespace at the end of the line
@@ -1710,22 +1711,22 @@ def test_repeat(self): | |||
def test_nat(self): | |||
self.assertIs(pd.TimedeltaIndex._na_value, pd.NaT) | |||
self.assertIs(pd.TimedeltaIndex([])._na_value, pd.NaT) | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same (and below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting this error from travis ci - The command "ci/lint.sh" exited with 1. How would I figure this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MattRijk If you look at the log of the failing travis build, at the bottom you will see the output of the linter:
pandas/tseries/tests/test_base.py:860:58: W291 trailing whitespace
pandas/tseries/tests/test_base.py:862:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:866:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:869:55: W291 trailing whitespace
pandas/tseries/tests/test_base.py:871:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:877:55: W291 trailing whitespace
pandas/tseries/tests/test_base.py:1713:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:1716:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:1721:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:1724:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:2710:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:2713:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:2718:1: W293 blank line contains whitespace
pandas/tseries/tests/test_base.py:2721:1: W293 blank line contains whitespace
You can normally set your editor to automatically remove trailing white space, then you would normally have less of such issues.
Current coverage is 85.26% (diff: 100%)@@ master #14347 diff @@
==========================================
Files 140 140
Lines 50632 50632
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43170 43171 +1
+ Misses 7462 7461 -1
Partials 0 0
|
thanks @MattRijk lgtm. |
…rors on 32-bit closes pandas-dev#14345 Author: mattrijk <[email protected]> Closes pandas-dev#14347 from MattRijk/issue#14345 and squashes the following commits: 73ad3d7 [mattrijk] line 2710 formatting update for whitespace ea4f151 [mattrijk] second formatting update for whitespace 262492f [mattrijk] TST: pandas-dev#14345 fixes TestDatetimeIndexOps test_nat AssertionErors
Changed tm.assert_numpy_array_equal(idx._nan_idxs, np.array([], dtype=np.int64)
np.int64 to npintp
All tests now pass on 32bit linux install.