Skip to content

Commit 2c2a221

Browse files
author
Jean-Mathieu Deschenes
committed
Changes based on review comments
* Fixed bug on windows with int32/int64 confusion * Added unit_test to is_timedelta64_dtype when a string is passed * Changed unit_test name from `test_slice_indexing` to `test_list_like_indexing`
1 parent 052a3fc commit 2c2a221

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pandas/tests/dtypes/test_common.py

+2
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def test_is_timedelta64_dtype():
204204
assert com.is_timedelta64_dtype(np.timedelta64)
205205
assert com.is_timedelta64_dtype(pd.Series([], dtype="timedelta64[ns]"))
206206

207+
assert not com.is_timedelta64_dtype("0 days 00:00:00")
208+
207209

208210
def test_is_period_dtype():
209211
assert not com.is_period_dtype(object)

pandas/tests/indexing/test_timedelta.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ def test_boolean_indexing(self):
1313
[0, 1, 2, 10, 4, 5, 6, 7, 8, 9],
1414
[10, 10, 10, 3, 4, 5, 6, 7, 8, 9]]
1515
for cond, data in zip(conditions, expected_data):
16-
result = df.assign(x=df.mask(cond, 10).astype(df['x'].dtype))
16+
result = df.assign(x=df.mask(cond, 10).astype('int64'))
1717
expected = pd.DataFrame(data,
1818
index=pd.to_timedelta(range(10), unit='s'),
19-
columns=['x'])
19+
columns=['x'],
20+
dtype='int64')
2021
tm.assert_frame_equal(expected, result)
2122

22-
def test_slice_indexing(self):
23+
def test_list_like_indexing(self):
2324
# GH 16637
2425
df = pd.DataFrame({'x': range(10)})
2526
df.index = pd.to_timedelta(range(10), unit='s')

0 commit comments

Comments
 (0)