Skip to content

Commit b22f215

Browse files
authored
TST: Add test for timedelta of fraction GH#9048 (#53552)
Signed-off-by: Liang Yan <[email protected]>
1 parent 9407518 commit b22f215

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/tools/test_to_timedelta.py

+5
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ def test_to_timedelta_numeric_ea(self, any_numeric_ea_dtype):
293293
expected = Series([pd.Timedelta(1, unit="ns"), pd.NaT])
294294
tm.assert_series_equal(result, expected)
295295

296+
def test_to_timedelta_fraction(self):
297+
result = to_timedelta(1.0 / 3, unit="h")
298+
expected = pd.Timedelta("0 days 00:19:59.999999998")
299+
assert result == expected
300+
296301

297302
def test_from_numeric_arrow_dtype(any_numeric_ea_dtype):
298303
# GH 52425

0 commit comments

Comments
 (0)