Skip to content

Commit 616416d

Browse files
committed
TST: move the test to indexes/datetimes/test_tools.py
1 parent 257d569 commit 616416d

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

pandas/tests/indexes/datetimes/test_tools.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,3 +2274,21 @@ def test_should_cache_errors(unique_share, check_count, err_message):
22742274

22752275
with pytest.raises(AssertionError, match=err_message):
22762276
tools.should_cache(arg, unique_share, check_count)
2277+
2278+
def test_intarray_to_datetime():
2279+
# Test for #30050
2280+
ser = pd.Series([1, 2, None, 2 ** 61, None])
2281+
ser = ser.astype("Int64")
2282+
2283+
res = pd.to_datetime(ser, unit="ns")
2284+
2285+
expected = pd.Series(
2286+
[
2287+
np.datetime64("1970-01-01 00:00:00.000000001"),
2288+
np.datetime64("1970-01-01 00:00:00.000000002"),
2289+
np.datetime64("NaT"),
2290+
np.datetime64("2043-01-25 23:56:49.213693952"),
2291+
np.datetime64("NaT"),
2292+
]
2293+
)
2294+
tm.assert_series_equal(res, expected)

pandas/tests/tools/test_datetime.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)