Skip to content

BUG: to_timedelta(pd.NA) raising ValueError #52909

Closed
@lukemanley

Description

@lukemanley

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

pd.to_datetime(pd.NA)   # -> NaT
pd.to_timedelta(pd.NA)  # -> ValueError: Value must be Timedelta, string, integer, float, timedelta or convertible, not NAType

Issue Description

to_timedelta(pd.NA) raising ValueError.

Expected Behavior

to_timedelta(pd.NA) should return NaT similar to to_datetime(pd.NA).

Installed Versions

.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions