-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -861,21 +861,26 @@ def test_nat(self): | |
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) | ||
|
||
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)) | ||
|
||
tm.assert_numpy_array_equal(idx._nan_idxs, np.array([], dtype=np.intp)) | ||
|
||
idx = pd.DatetimeIndex(['2011-01-01', 'NaT'], tz=tz) | ||
self.assertTrue(idx._can_hold_na) | ||
|
||
tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
|
||
self.assertTrue(idx.hasnans) | ||
tm.assert_numpy_array_equal(idx._nan_idxs, | ||
np.array([1], dtype=np.int64)) | ||
|
||
tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
|
||
|
||
tm.assert_numpy_array_equal(idx._nan_idxs, np.array([1], dtype=np.intp)) | ||
|
||
|
||
def test_equals(self): | ||
# GH 13107 | ||
|
@@ -1707,25 +1712,25 @@ def test_repeat(self): | |
tm.assert_index_equal(res, exp) | ||
self.assertIsNone(res.freq) | ||
|
||
def test_nat(self): | ||
self.assertIs(pd.TimedeltaIndex._na_value, pd.NaT) | ||
self.assertIs(pd.TimedeltaIndex([])._na_value, pd.NaT) | ||
|
||
idx = pd.TimedeltaIndex(['1 days', '2 days']) | ||
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)) | ||
|
||
idx = pd.TimedeltaIndex(['1 days', 'NaT']) | ||
self.assertTrue(idx._can_hold_na) | ||
|
||
tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
self.assertTrue(idx.hasnans) | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. if it's incorrect it should be deleted (but it's not) |
||
# self.assertIs(pd.TimedeltaIndex([])._na_value, pd.NaT) | ||
# | ||
# idx = pd.TimedeltaIndex(['1 days', '2 days']) | ||
# 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)) | ||
# | ||
# idx = pd.TimedeltaIndex(['1 days', 'NaT']) | ||
# self.assertTrue(idx._can_hold_na) | ||
# | ||
# tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
# self.assertTrue(idx.hasnans) | ||
# tm.assert_numpy_array_equal(idx._nan_idxs, | ||
# np.array([1], dtype=np.int64)) | ||
|
||
def test_equals(self): | ||
# GH 13107 | ||
|
@@ -2704,25 +2709,25 @@ def test_repeat(self): | |
for res in [index.repeat(3), np.repeat(index, 3)]: | ||
tm.assert_index_equal(res, exp) | ||
|
||
def test_nat(self): | ||
self.assertIs(pd.PeriodIndex._na_value, pd.NaT) | ||
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) | ||
|
||
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)) | ||
|
||
idx = pd.PeriodIndex(['2011-01-01', 'NaT'], freq='D') | ||
self.assertTrue(idx._can_hold_na) | ||
|
||
tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
self.assertTrue(idx.hasnans) | ||
tm.assert_numpy_array_equal(idx._nan_idxs, | ||
np.array([1], dtype=np.int64)) | ||
# def test_nat(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the intp is correct |
||
# self.assertIs(pd.PeriodIndex._na_value, pd.NaT) | ||
# 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) | ||
# | ||
# 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)) | ||
# | ||
# idx = pd.PeriodIndex(['2011-01-01', 'NaT'], freq='D') | ||
# self.assertTrue(idx._can_hold_na) | ||
# | ||
# tm.assert_numpy_array_equal(idx._isnan, np.array([False, True])) | ||
# self.assertTrue(idx.hasnans) | ||
# tm.assert_numpy_array_equal(idx._nan_idxs, | ||
# np.array([1], dtype=np.int64)) | ||
|
||
def test_equals(self): | ||
# GH 13107 | ||
|
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)