Feature Type

  • [ ] Adding new functionality to pandas

  • [X] Changing existing functionality in pandas

  • [ ] Removing existing functionality in pandas

Problem Description

Sorry if this is a duplicate or irrelevant. I searched in bugtracker and code and couldn't find anything related.

Python 3.11 introduces a new version of fromisoformat for datetime, date and time. There are backports in PyPI for older Python versions. While the former version would only deserialize the output of isoformat, this new method is meant to deserialize any ISO8601 datetime. Being C code, it is also supposed to be more performant than user Python code. It is a good replacement option in libs implementing their own deserialization.

The pandas case might be different since I guess it happens in C already (I didn't find it in the code but I'm pretty sure), so perhaps the performance gain would be minimal if any. Still in terms of maintenance, it may be better to rely on standard lib than maintain a parallel implementation. Assuming it is possible to call those methods from pandas C code without too much trouble.

Feature Description

Use standard lib fromisodatetime to deserialize datetimes.

Alternative Solutions

Keep things as they are.

Additional Context

Just a friendly hint. Feel free to close if this is just noise based on wrong assumptions.

Comment From: MarcoGorelli

I guess it happens in C already (I didn't find it in the code but I'm pretty sure)

Yup - https://github.com/pandas-dev/pandas/blob/b9980b66b86489f0df88e09a93529d98e6371135/pandas/_libs/tslibs/src/datetime/np_datetime_strings.c

Maybe this can be revisited in a few years', but in the meantime it'd be better to not add runtime dependencies with backports

Comment From: MarcoGorelli

also, there wouldn't be a way to respect exact - closing then, but thanks for the suggestion